OSDN Git Service

ソケットの終了処理追加。
[wordring-tm/wordring-tm.git] / proxy / tmeditorwidget.h
index 4108335..ab4218b 100644 (file)
@@ -53,6 +53,8 @@ public:
        void attach(SocketConnection *socket);
        void detach(SocketConnection *socket);
 
+       void set_http_port(quint16 http_port);
+
        void set_edit_mode(bool mode);
        bool edit_mode();
        void set_link_mode(bool mode);
@@ -63,11 +65,15 @@ public:
        int target_language();
 
        void set_string(QString source_, QString target_);
+       void append_sentence();
+       void save_sentence();
 
 signals:
        void editModeChanged(bool mode_);
        void linkModeChanged(bool mode_);
 
+       void contentsEdited();
+
 public slots:
        void onLanguageLoaded(int code, QString name, QIcon icon);
        void onEditModeTriggered(bool);
@@ -80,6 +86,7 @@ private:
        QMutex m_mutex;
        Service *m_service;
        Settings *m_settings;
+       quint16 m_http_port;
        SocketConnection *m_socket;
 
        QToolBar *m_toolbar;
@@ -163,6 +170,9 @@ public:
 
        void set_sentence(Text::pointer sentence);
 
+       bool is_text_saved() const;
+       void set_text_saved(bool saved);
+
        bool is_text_dirty() const;
        void set_text_dirty(bool dirty);
 
@@ -184,22 +194,13 @@ protected:
 
 private:
        SourcePanel *m_source_panel;
-       bool m_text_dirty;
+       bool m_text_dirty; /*!< 内容の変更を示すフラグ */
+       bool m_text_saved; /*!< データベース登録の必要性を示すフラグ */
 };
 
 class Editor : public TextWidget
 {
        Q_OBJECT
-/*     enum : int
-       {
-               TextSourceSentence = QTextCharFormat::UserProperty,
-               TextSourceWord,
-               TextTargetSentence = QTextCharFormat::UserProperty + 10,
-               TextTargetWord,
-               TextCurrentBlock,
-               TextCurrentEditor,
-       };
-*/
 public:
        Editor(Settings *settings, Service *service, QWidget *parent);
 
@@ -213,7 +214,7 @@ public:
 
        bool can_link_mode() const;
 
-       EditorWidget* parent_widget();
+       EditorWidget* parent_editor_widget();
        TargetPanel* current_target_panel();
        TargetPanel const* current_target_panel() const;