ginebra2/EditorSnippet.h
changeset 16 3c88a81ff781
parent 3 0954f5dd2cd0
equal deleted inserted replaced
14:6aeb7a756187 16:3c88a81ff781
    38        static EditorSnippet * instance(const QString& elementId, ChromeWidget * chrome, const QWebElement & element);
    38        static EditorSnippet * instance(const QString& elementId, ChromeWidget * chrome, const QWebElement & element);
    39        virtual void setChromeWidget(QGraphicsWidget * widget);
    39        virtual void setChromeWidget(QGraphicsWidget * widget);
    40        Q_PROPERTY( QString text READ text WRITE setText)
    40        Q_PROPERTY( QString text READ text WRITE setText)
    41        void setText( const QString & text );
    41        void setText( const QString & text );
    42        QString text();
    42        QString text();
       
    43 #ifdef BROWSER_LAYOUT_TENONE
       
    44        void setTextFont(QFont & font);
       
    45 #endif
    43     public slots:
    46     public slots:
    44        int charCount();
    47        int charCount();
    45        void setCursorPosition(int pos);
    48        void setCursorPosition(int pos);
    46        void selectAll();
    49        void selectAll();
    47        void unselect();
    50        void unselect();
    48        void onFocusChanged(bool in);
    51        void onFocusChanged(bool in);
    49        void onTapped(QPointF& pos);
       
    50        int getTextOptions();
    52        int getTextOptions();
    51        // Calling this function will overwrite the existing options
    53        // Calling this function will overwrite the existing options
    52        void setTextOptions(int flag);
    54        void setTextOptions(int flag);       void setMaxTextLength(int length);
    53        void setMaxTextLength(int length);
    55        bool editable() { return true; }
       
    56        void cut();
       
    57        void copy();
       
    58        void paste();
       
    59        void sendContextMenuEvent(bool isContentSelected);
       
    60        void setContextMenuStatus(bool on);
    54     signals:
    61     signals:
    55        void activated();
    62        void activated();
    56        void lostFocus();
    63        void lostFocus();
    57        void gainedFocus();
    64        void gainedFocus();
    58        void textChanged();
    65        void textChanged();
       
    66        void contextEvent(bool isContentSelected, QString snippetId);
    59     private:
    67     private:
    60        void connectAll();
    68        void connectAll();
       
    69        TextEditItem *textEditItem();
    61   };
    70   };
    62 }
    71 }
    63 
    72 
    64 #endif
    73 #endif