⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 informationwindow.hpp

📁 一个基于BREW上的WEB service程序,通过扫描图书的条形码,登陆WEB站点,利用SOAP-RPC来查询图书信息.
💻 HPP
字号:
//
//      InformationWindow.hpp
//
//

#ifndef __INFORMATIONWINDOW_HPP
#define __INFORMATIONWINDOW_HPP

#include <SophiaFramework.hpp>
#include "SGXAWSParser.hpp"
#include "RecogWindow.hpp"

SFMRESPONDERBEHAVIOR(LINKLABEL, BEHAVIOR_CONTROL, PROPERTY_DIRECT, APPEARANCE_SHADOW | APPEARANCE_TRANSPARENT)
SFMTYPEDEFCLASS(LinkLabel)
class LinkLabel : public SFRButtonBase {
private:
    SFXWideString           _title;
public:
    LinkLabel  (SFRResponderPtr, SFXRectangleConstRef, SFXWideStringConstRef, BehaviorType = BEHAVIOR_LINKLABEL);
    ~LinkLabel  (Void);
    Void                        SetTitle            (SFXWideStringConstRef);
    SFXWideStringConstRef       GetTitle            (Void) const;
private:
    virtual Void  HandleRelease       (Void);
    virtual Void  HandleContent  (SFXGraphicsPtr);
};

SFMTYPEDEFCLASS(ScrollTabPane)
class ScrollTabPane : public SFRTabPane {
    SFMSEALCOPY(ScrollTabPane)
public:
    ScrollTabPane(SFRTabControlPtr tab, SFXWideStringConstRef title);
    Void SetHeight(SInt16 height);
private:
    HANDLER_DECLARE_BOOLEVENT(ScrollTabPane, OnKey)
    HANDLER_DECLARE_BOOLRENDER(ScrollTabPane, OnRender)
};

SFMTYPEDEFCLASS(AWSTabPane)
class AWSTabPane : public ScrollTabPane {
    SFMSEALCOPY(AWSTabPane)
private:
    SFUHttpConnection _http;
    SFUSourceStreamPtr _source;
    SFXAnsiString _string;
    SGXAWSParser _parser;

    SFXProperty _value;
    UInt16 _maxWidth;
public:
    AWSTabPane(SFRTabControlPtr tab, SFXWideStringConstRef title);
    virtual ~AWSTabPane(Void);
    SFCError MakeLabels(Void);
    SFCError Append(SFXAnsiStringConstRef name, SFXAnsiStringConstRef value);
    SFCError Append(SFXAnsiStringConstRef name, SInt32 value);
    Void Clear(Void);
private:
    HANDLER_DECLARE_VOIDCONTROL(AWSTabPane, OnLink)

    // HttpConnection 偺捠抦僐乕儖僶僢僋娭悢
    Void HttpNotify(SFUHttpConnection::NotifyEnum notify, SFCError error);
    static Void HttpNotifyEntry(
        SFUHttpConnection::NotifyEnum notify, SFCError error, VoidPtr data)
    { AWSTabPanePtr(data)->HttpNotify(notify, error); }

    // SourceStream 偺捠抦僐乕儖僶僢僋娭悢
    Void SourceNotify(SFUSourceStream::NotifyEnum notify, SFCError error);
    static Void SourceNotifyEntry(
        SFUSourceStream::NotifyEnum notify, SFCError error, VoidPtr data)
    { AWSTabPanePtr(data)->SourceNotify(notify, error); }

    Void ProceedNetworkError(Void);

};

SFMTYPEDEFCLASS(AWSReviewTabPane)
class AWSReviewTabPane : public ScrollTabPane {
    SFMSEALCOPY(AWSReviewTabPane)
private:
    SGXAWSParserPtr _parser;
public:
    AWSReviewTabPane(SFRTabControlPtr tab, SFXWideStringConstRef title, SGXAWSParserPtr parser) static_throws;
    SFCError MakeLabels(Void);
};

SFMTYPEDEFCLASS(AWSImageTabPane)
class AWSImageTabPane : public ScrollTabPane {
    SFMSEALCOPY(AWSImageTabPane)
private:
    SFUHttpConnection _http;
    SFUSourceStreamPtr _source;
    SFXAnsiString _url;
    SFXAnsiString _asin;
    SFXBuffer _imageBuffer;
    SFBImageSmp _image;
public:
    AWSImageTabPane(SFRTabControlPtr tab, SFXWideStringConstRef title, SFXAnsiStringConstRef url, SFXAnsiStringConstRef asin);
    virtual ~AWSImageTabPane(Void);
private:
    HANDLER_DECLARE_VOIDRENDER(AWSImageTabPane, OnRenderContent)
    HANDLER_DECLARE_VOIDCONTROL(AWSImageTabPane, OnButtonControl)

    // HttpConnection 偺捠抦僐乕儖僶僢僋娭悢
    Void HttpNotify(SFUHttpConnection::NotifyEnum notify, SFCError error);
    static Void HttpNotifyEntry(
        SFUHttpConnection::NotifyEnum notify, SFCError error, VoidPtr data)
    { AWSImageTabPanePtr(data)->HttpNotify(notify, error); }

    // SourceStream 偺捠抦僐乕儖僶僢僋娭悢
    Void SourceNotify(SFUSourceStream::NotifyEnum notify, SFCError error);
    static Void SourceNotifyEntry(
        SFUSourceStream::NotifyEnum notify, SFCError error, VoidPtr data)
    { AWSImageTabPanePtr(data)->SourceNotify(notify, error); }

    Void ProceedNetworkError(Void);
};

SFMRESPONDERATTRIBUTE(INFORMATIONWINDOW, four_char_code('I', 'n', 'f', 'o'))

SFMTYPEDEFCLASS(InformationWindow)
class InformationWindow : public SFRPlainWindow {
    SFMSEALCOPY(InformationWindow)
private:
    enum {
        OPERATION_BBS,
        OPERATION_BUY,
        OPERATION_LIMIT
    };

    SGXAWSParserPtr _parser;
    RecogWindowPtr _barcode;

public:
    explicit InformationWindow(SGXAWSParserPtr parser, RecogWindowPtr barcode) static_throws;
    virtual ~InformationWindow(Void);
private:
    HANDLER_DECLARE_BOOLEVENT(InformationWindow, OnKey)
    HANDLER_DECLARE_VOIDEVENT(InformationWindow, OnSoftkey)
    HANDLER_DECLARE_VOIDMENU(InformationWindow, FromSoftkey2)
    SFCError MakeDialog(Void);
    SFCError MakeGeneralPane(SFRTabControlPtr tab);
    SFCError MakeDetailPane(SFRTabControlPtr tab);
    SFCError MakeSimilarPane(SFRTabControlPtr tab);
};

#endif // __INFORMATIONWINDOW_HPP //

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -