00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef TEXTEDIT_H
00023 #define TEXTEDIT_H
00024
00025 #define QTEXTEDIT_OPEN_API
00026
00027
00028
00029
00030 #include <qpe/filemanager.h>
00031 #include <qpe/qcopenvelope_qws.h>
00032
00033
00034
00035 #include <qmainwindow.h>
00036 #include <qmultilineedit.h>
00037 #include <qlist.h>
00038 #include <qmap.h>
00039
00040 class QAction;
00041 class QWidgetStack;
00042 class QToolButton;
00043 class QPopupMenu;
00044 class QToolBar;
00045 class QLineEdit;
00046 class QAction;
00047 class FileSelector;
00048 class QpeEditor;
00049 class QPopupMenu;
00050 class QTimer;
00051
00052 class TextEdit : public QMainWindow
00053 {
00054 Q_OBJECT
00055
00056 public:
00057 static QString appName() { return QString::fromLatin1("textedit"); }
00058 TextEdit( QWidget *parent = 0, const char *name = 0, WFlags f = 0 );
00059 ~TextEdit();
00060
00061 protected:
00062 QPopupMenu *font;
00063 QAction *nStart, *nFileDlgOpt, *nAdvanced, *desktopAction, *filePermAction, *searchBarAction, *nAutoSave;
00064 bool edited, edited1;
00065 void openFile( const QString & );
00066 QCopChannel * channel;
00067
00068 bool featureAutoSave;
00069 void closeEvent( QCloseEvent *e );
00070 void doSearchBar();
00071 int savePrompt();
00072 void setTimer();
00073 private slots:
00074 void editorChanged();
00075 void receive(const QCString&, const QByteArray&);
00076 void timerCrank();
00077 void doTimer(bool);
00078 void editPasteTimeDate();
00079 void doPrompt(bool);
00080 void doDesktop(bool);
00081 void doFilePerms(bool);
00082 void doAbout();
00083 void setDocument(const QString&);
00084 void changeFont();
00085 void fileNew();
00086 void fileRevert();
00087 void fileOpen();
00088 void changeStartConfig(bool);
00089 bool save();
00090 bool saveAs();
00091 void cleanUp();
00092
00093 void gotoLine();
00094 void doGoto();
00095
00096
00097 void editCut();
00098 void editCopy();
00099 void editPaste();
00100 void editFind();
00101 void editDelete();
00102
00103 void findNext();
00104 void findClose();
00105
00106 void search();
00107 void accept();
00108
00109 void newFile( const DocLnk & );
00110 void openFile( const DocLnk & );
00111 void showEditTools();
00112
00113 void zoomIn();
00114 void zoomOut();
00115 void setBold(bool y);
00116 void setItalic(bool y);
00117 void setWordWrap(bool y);
00118 void setSearchBar(bool);
00119
00120 private:
00121 void openDotFile(const QString &);
00122 void colorChanged( const QColor &c );
00123 void clear();
00124 void updateCaption( const QString &name=QString::null );
00125 void setFontSize(int sz, bool round_down_not_up);
00126 private:
00127
00128
00129 bool fromSetDocument;
00130 QpeEditor* editor;
00131 QToolBar *menu, *editBar, *searchBar;
00132 QPopupMenu *advancedMenu;
00133 QLineEdit *gotoEdit;
00134 QLineEdit *searchEdit;
00135 DocLnk *doc;
00136 bool fileIs, useAdvancedFeatures, promptExit, openDesktop, filePerms, useSearchBar, startWithNew;
00137 bool bFromDocView;
00138 int viewSelection;
00139 QAction *zin, *zout;
00140 QString currentFileName;
00141 };
00142
00143 #endif