TDE graphics utilities
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

kpmainwindow.h 21KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740
  1. /*
  2. Copyright (c) 2003,2004,2005 Clarence Dang <dang@kde.org>
  3. All rights reserved.
  4. Redistribution and use in source and binary forms, with or without
  5. modification, are permitted provided that the following conditions
  6. are met:
  7. 1. Redistributions of source code must retain the above copyright
  8. notice, this list of conditions and the following disclaimer.
  9. 2. Redistributions in binary form must reproduce the above copyright
  10. notice, this list of conditions and the following disclaimer in the
  11. documentation and/or other materials provided with the distribution.
  12. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  13. IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  14. OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  15. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  16. INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  17. NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  18. DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  19. THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  20. (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  21. THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  22. */
  23. #ifndef KP_MAIN_WINDOW_H
  24. #define KP_MAIN_WINDOW_H
  25. #define DEBUG_KP_MAIN_WINDOW 0
  26. #include <tqpoint.h>
  27. #include <tqptrlist.h>
  28. #include <tqsize.h>
  29. #include <tqvaluevector.h>
  30. #include <tdemainwindow.h>
  31. #include <kurl.h>
  32. #include <kpdefs.h>
  33. #include <kpdocumentsaveoptions.h>
  34. #include <kppixmapfx.h>
  35. class TQPainter;
  36. class TQPoint;
  37. class TQPopupMenu;
  38. class TQRect;
  39. class TQSize;
  40. class TQStringList;
  41. class TDEAction;
  42. class TDEFontAction;
  43. class TDEFontSizeAction;
  44. class TDESelectAction;
  45. class TDEToggleAction;
  46. class TDEToolBar;
  47. class KPrinter;
  48. class TDERecentFilesAction;
  49. class KScanDialog;
  50. class TDEToggleFullScreenAction;
  51. class kpColor;
  52. class kpColorToolBar;
  53. class kpCommand;
  54. class kpCommandHistory;
  55. class kpDocument;
  56. class kpDocumentMetaInfo;
  57. class kpDocumentSaveOptions;
  58. class kpViewManager;
  59. class kpViewScrollableContainer;
  60. class kpSelection;
  61. class kpSelectionTransparency;
  62. class kpSingleKeyTriggersAction;
  63. class kpSqueezedTextLabel;
  64. class kpTextStyle;
  65. class kpThumbnail;
  66. class kpThumbnailView;
  67. class kpTool;
  68. class kpToolText;
  69. class kpToolToolBar;
  70. class kpZoomedView;
  71. class kpMainWindow : public TDEMainWindow
  72. {
  73. Q_OBJECT
  74. public:
  75. // Opens a new window with a blank document.
  76. kpMainWindow ();
  77. // Opens a new window with the document specified by <url>
  78. // or creates a blank document if <url> could not be opened.
  79. kpMainWindow (const KURL &url);
  80. // Opens a new window with the document <newDoc>
  81. // (<newDoc> can be 0 although this would result in a new
  82. // window without a document at all).
  83. kpMainWindow (kpDocument *newDoc);
  84. public:
  85. double configColorSimilarity () const;
  86. void configSetColorSimilarity (double val);
  87. private:
  88. bool m_configFirstTime;
  89. bool m_configShowGrid;
  90. bool m_configShowPath;
  91. double m_configColorSimilarity;
  92. bool m_configThumbnailShown;
  93. TQRect m_configThumbnailGeometry;
  94. bool m_configZoomedThumbnail;
  95. void readGeneralSettings ();
  96. void readThumbnailSettings ();
  97. void init ();
  98. // (only called for restoring a previous session e.g. starting KDE with
  99. // a previously saved session; it's not called on normal KolourPaint
  100. // startup)
  101. virtual void readProperties (TDEConfig *cfg);
  102. // (only called for saving the current session e.g. logging out of KDE
  103. // with the KolourPaint window open; it's not called on normal KolourPaint
  104. // exit)
  105. virtual void saveProperties (TDEConfig *cfg);
  106. public:
  107. ~kpMainWindow ();
  108. private:
  109. bool m_isFullyConstructed;
  110. public:
  111. kpDocument *document () const;
  112. kpViewManager *viewManager () const;
  113. kpColorToolBar *colorToolBar () const;
  114. kpToolToolBar *toolToolBar () const;
  115. kpCommandHistory *commandHistory () const;
  116. private:
  117. kpViewScrollableContainer *m_scrollView;
  118. kpZoomedView *m_mainView;
  119. kpThumbnail *m_thumbnail;
  120. kpThumbnailView *m_thumbnailView;
  121. kpDocument *m_document;
  122. kpViewManager *m_viewManager;
  123. kpColorToolBar *m_colorToolBar;
  124. kpToolToolBar *m_toolToolBar;
  125. kpCommandHistory *m_commandHistory;
  126. private:
  127. void setupActions ();
  128. void enableDocumentActions (bool enable = true);
  129. public:
  130. bool actionsSingleKeyTriggersEnabled () const;
  131. void enableActionsSingleKeyTriggers (bool enable = true);
  132. private:
  133. void setDocument (kpDocument *newDoc);
  134. virtual bool queryClose ();
  135. virtual void dragEnterEvent (TQDragEnterEvent *e);
  136. virtual void dropEvent (TQDropEvent *e);
  137. private slots:
  138. void slotScrollViewAboutToScroll ();
  139. void slotScrollViewAfterScroll ();
  140. private:
  141. virtual void moveEvent (TQMoveEvent *e);
  142. private slots:
  143. void slotUpdateCaption ();
  144. void slotDocumentRestored ();
  145. /*
  146. * Tools
  147. */
  148. private:
  149. void setupToolActions ();
  150. void createToolBox ();
  151. void enableToolsDocumentActions (bool enable = true);
  152. private slots:
  153. void updateToolOptionPrevNextActionsEnabled ();
  154. private:
  155. kpTool *m_toolAirSpray, *m_toolBrush, *m_toolColorPicker,
  156. *m_toolColorWasher, *m_toolCurve, *m_toolEllipse,
  157. *m_toolEllipticalSelection, *m_toolEraser,
  158. *m_toolFloodFill, *m_toolFreeFormSelection,
  159. *m_toolLine, *m_toolPen, *m_toolPolygon,
  160. *m_toolPolyline, *m_toolRectangle, *m_toolRectSelection,
  161. *m_toolRoundedRectangle;
  162. kpToolText *m_toolText;
  163. TQPtrList <kpTool> m_tools;
  164. int m_lastToolNumber;
  165. bool m_toolActionsEnabled;
  166. kpSingleKeyTriggersAction *m_actionPrevToolOptionGroup1,
  167. *m_actionNextToolOptionGroup1,
  168. *m_actionPrevToolOptionGroup2,
  169. *m_actionNextToolOptionGroup2;
  170. int m_settingSelectionTransparency;
  171. int m_docResizeWidth, m_docResizeHeight;
  172. bool m_docResizeToBeCompleted;
  173. public:
  174. kpTool *tool () const;
  175. bool toolHasBegunShape () const;
  176. bool toolIsASelectionTool (bool includingTextTool = true) const;
  177. bool toolIsTextTool () const;
  178. kpSelectionTransparency selectionTransparency () const;
  179. // The drawing background color is set to <transparency>.transparentColor()
  180. // if the <transparency> is in Transparent mode or if <forceColorChange>
  181. // is true (not the default). [x]
  182. //
  183. // If <transparency> is in Opaque mode and <forceColorChange> is false,
  184. // the background color is not changed because:
  185. //
  186. // 1. It is ignored by the selection in Opaque mode anyway.
  187. // 2. This avoids irritating the user with an unnecessary background
  188. // color change.
  189. //
  190. // The only case where you should set <forceColorChange> to true is in
  191. // kpToolSelectionTransparencyCommand to ensure that the state
  192. // is identical to when the command was constructed.
  193. // Later: I don't think setting it to true is ever necessary since:
  194. //
  195. // 1. The background color only counts in Transparent mode.
  196. //
  197. // 2. Any kpToolSelectionTransparencyCommand that switches to
  198. // Transparent mode will automatically set the background
  199. // color due to the first part of [x] anyway.
  200. //
  201. // The other fields of <transparency> are copied into the main window
  202. // as expected.
  203. void setSelectionTransparency (const kpSelectionTransparency &transparency,
  204. bool forceColorChange = false);
  205. int settingSelectionTransparency () const;
  206. private slots:
  207. void slotToolSelected (kpTool *tool);
  208. private:
  209. void readLastTool ();
  210. int toolNumber () const;
  211. void saveLastTool ();
  212. private:
  213. bool maybeDragScrollingMainView () const;
  214. private slots:
  215. bool slotDragScroll (const TQPoint &docPoint,
  216. const TQPoint &docLastPoint,
  217. int zoomLevel,
  218. bool *didSomething);
  219. bool slotEndDragScroll ();
  220. private slots:
  221. void slotBeganDocResize ();
  222. void slotContinuedDocResize (const TQSize &size);
  223. void slotCancelledDocResize ();
  224. void slotEndedDocResize (const TQSize &size);
  225. void slotDocResizeMessageChanged (const TQString &string);
  226. private slots:
  227. void slotActionPrevToolOptionGroup1 ();
  228. void slotActionNextToolOptionGroup1 ();
  229. void slotActionPrevToolOptionGroup2 ();
  230. void slotActionNextToolOptionGroup2 ();
  231. public slots:
  232. void slotToolAirSpray ();
  233. void slotToolBrush ();
  234. void slotToolColorPicker ();
  235. void slotToolColorWasher ();
  236. void slotToolCurve ();
  237. void slotToolEllipse ();
  238. void slotToolEllipticalSelection ();
  239. void slotToolEraser ();
  240. void slotToolFloodFill ();
  241. void slotToolFreeFormSelection ();
  242. void slotToolLine ();
  243. void slotToolPen ();
  244. void slotToolPolygon ();
  245. void slotToolPolyline ();
  246. void slotToolRectangle ();
  247. void slotToolRectSelection ();
  248. void slotToolRoundedRectangle ();
  249. void slotToolText ();
  250. /*
  251. * File Menu
  252. */
  253. private:
  254. void setupFileMenuActions ();
  255. void enableFileMenuDocumentActions (bool enable = true);
  256. TDEAction *m_actionNew, *m_actionOpen;
  257. TDERecentFilesAction *m_actionOpenRecent;
  258. TDEAction *m_actionScan, *m_actionSave, *m_actionSaveAs, *m_actionExport,
  259. *m_actionReload,
  260. *m_actionPrint, *m_actionPrintPreview,
  261. *m_actionMail,
  262. *m_actionSetAsWallpaperTiled, *m_actionSetAsWallpaperCentered,
  263. *m_actionClose, *m_actionQuit;
  264. KScanDialog *m_scanDialog;
  265. KURL m_lastExportURL;
  266. kpDocumentSaveOptions m_lastExportSaveOptions;
  267. bool m_exportFirstTime;
  268. private:
  269. void addRecentURL (const KURL &url);
  270. private slots:
  271. void slotNew ();
  272. private:
  273. TQSize defaultDocSize () const;
  274. void saveDefaultDocSize (const TQSize &size);
  275. private:
  276. bool shouldOpenInNewWindow () const;
  277. void setDocumentChoosingWindow (kpDocument *doc);
  278. private:
  279. kpDocument *openInternal (const KURL &url,
  280. const TQSize &fallbackDocSize,
  281. bool newDocSameNameIfNotExist);
  282. // Same as above except that it:
  283. //
  284. // 1. Assumes a default fallback document size.
  285. // 2. If the URL is successfully opened (with the special exception of
  286. // the "kolourpaint doesnotexist.png" case), it is bubbled up to the
  287. // top in the Recent Files Action.
  288. //
  289. // As a result of this behavior, this should only be called in response
  290. // to a user open request e.g. File / Open or "kolourpaint doesexist.png".
  291. // It should not be used for session restore - in that case, it does not
  292. // make sense to bubble the Recent Files list.
  293. bool open (const KURL &url, bool newDocSameNameIfNotExist = false);
  294. KURL::List askForOpenURLs (const TQString &caption,
  295. const TQString &startURL,
  296. bool allowMultipleURLs = true);
  297. private slots:
  298. void slotOpen ();
  299. void slotOpenRecent (const KURL &url);
  300. void slotScan ();
  301. void slotScanned (const TQImage &image, int);
  302. bool save (bool localOnly = false);
  303. bool slotSave ();
  304. private:
  305. KURL askForSaveURL (const TQString &caption,
  306. const TQString &startURL,
  307. const TQPixmap &pixmapToBeSaved,
  308. const kpDocumentSaveOptions &startSaveOptions,
  309. const kpDocumentMetaInfo &docMetaInfo,
  310. const TQString &forcedSaveOptionsGroup,
  311. bool localOnly,
  312. kpDocumentSaveOptions *chosenSaveOptions,
  313. bool isSavingForFirstTime,
  314. bool *allowOverwritePrompt,
  315. bool *allowLossyPrompt);
  316. private slots:
  317. bool saveAs (bool localOnly = false);
  318. bool slotSaveAs ();
  319. bool slotExport ();
  320. void slotEnableReload ();
  321. bool slotReload ();
  322. private:
  323. void sendFilenameToPrinter (KPrinter *printer);
  324. void sendPixmapToPrinter (KPrinter *printer, bool showPrinterSetupDialog);
  325. private slots:
  326. void slotPrint ();
  327. void slotPrintPreview ();
  328. void slotMail ();
  329. private:
  330. void setAsWallpaper (bool centered);
  331. private slots:
  332. void slotSetAsWallpaperCentered ();
  333. void slotSetAsWallpaperTiled ();
  334. void slotClose ();
  335. void slotQuit ();
  336. /*
  337. * Edit Menu
  338. */
  339. private:
  340. kpPixmapFX::WarnAboutLossInfo pasteWarnAboutLossInfo ();
  341. void setupEditMenuActions ();
  342. void enableEditMenuDocumentActions (bool enable = true);
  343. bool m_editMenuDocumentActionsEnabled;
  344. TDEAction *m_actionUndo, *m_actionRedo,
  345. *m_actionCut, *m_actionCopy,
  346. *m_actionPaste, *m_actionPasteInNewWindow,
  347. *m_actionDelete,
  348. *m_actionSelectAll, *m_actionDeselect,
  349. *m_actionCopyToFile, *m_actionPasteFromFile;
  350. KURL m_lastPasteFromURL;
  351. KURL m_lastCopyToURL;
  352. kpDocumentSaveOptions m_lastCopyToSaveOptions;
  353. bool m_copyToFirstTime;
  354. public:
  355. TQPopupMenu *selectionToolRMBMenu ();
  356. private slots:
  357. void slotCut ();
  358. void slotCopy ();
  359. void slotEnablePaste ();
  360. private:
  361. TQRect calcUsefulPasteRect (int pixmapWidth, int pixmapHeight);
  362. void paste (const kpSelection &sel,
  363. bool forceTopLeft = false);
  364. public:
  365. // (<forceNewTextSelection> is ignored if <text> is empty)
  366. void pasteText (const TQString &text,
  367. bool forceNewTextSelection = false,
  368. const TQPoint &newTextSelectionTopLeft = KP_INVALID_POINT);
  369. void pasteTextAt (const TQString &text, const TQPoint &point,
  370. // Allow tiny adjustment of <point> so that mouse
  371. // pointer is not exactly on top of the topLeft of
  372. // any new text selection (so that it doesn't look
  373. // weird by being on top of a resize handle just after
  374. // a paste).
  375. bool allowNewTextSelectionPointShift = false);
  376. public slots:
  377. void slotPaste ();
  378. private slots:
  379. void slotPasteInNewWindow ();
  380. public slots:
  381. void slotDelete ();
  382. void slotSelectAll ();
  383. private:
  384. void addDeselectFirstCommand (kpCommand *cmd);
  385. public slots:
  386. void slotDeselect ();
  387. private slots:
  388. void slotCopyToFile ();
  389. void slotPasteFromFile ();
  390. /*
  391. * View Menu
  392. */
  393. private:
  394. bool m_viewMenuDocumentActionsEnabled;
  395. void setupViewMenuActions ();
  396. bool viewMenuDocumentActionsEnabled () const;
  397. void enableViewMenuDocumentActions (bool enable = true);
  398. void actionShowGridUpdate ();
  399. TDEAction *m_actionFullScreenBIC,
  400. *m_actionActualSize,
  401. *m_actionFitToPage, *m_actionFitToWidth, *m_actionFitToHeight,
  402. *m_actionZoomIn, *m_actionZoomOut;
  403. TDESelectAction *m_actionZoom;
  404. TDEToggleAction *m_actionShowGrid,
  405. *m_actionShowThumbnail, *m_actionZoomedThumbnail;
  406. TQValueVector <int> m_zoomList;
  407. private:
  408. void sendZoomListToActionZoom ();
  409. int zoomLevelFromString (const TQString &string);
  410. TQString zoomLevelToString (int zoomLevel);
  411. void zoomTo (int zoomLevel, bool centerUnderCursor = false);
  412. private slots:
  413. void finishZoomTo ();
  414. private slots:
  415. void slotActualSize ();
  416. void slotFitToPage ();
  417. void slotFitToWidth ();
  418. void slotFitToHeight ();
  419. public:
  420. void zoomIn (bool centerUnderCursor = false);
  421. void zoomOut (bool centerUnderCursor = false);
  422. public slots:
  423. void slotZoomIn ();
  424. void slotZoomOut ();
  425. private:
  426. void zoomAccordingToZoomAction (bool centerUnderCursor = false);
  427. private slots:
  428. void slotZoom ();
  429. void slotShowGridToggled ();
  430. private:
  431. void updateMainViewGrid ();
  432. private:
  433. TQRect mapToGlobal (const TQRect &rect) const;
  434. TQRect mapFromGlobal (const TQRect &rect) const;
  435. private slots:
  436. void slotDestroyThumbnailIfNotVisible (bool tnIsVisible);
  437. void slotDestroyThumbnail ();
  438. void slotDestroyThumbnailInitatedByUser ();
  439. void slotCreateThumbnail ();
  440. private:
  441. TQTimer *m_thumbnailSaveConfigTimer;
  442. public:
  443. void notifyThumbnailGeometryChanged ();
  444. private slots:
  445. void slotSaveThumbnailGeometry ();
  446. void slotShowThumbnailToggled ();
  447. void updateThumbnailZoomed ();
  448. void slotZoomedThumbnailToggled ();
  449. void slotThumbnailShowRectangleToggled ();
  450. private:
  451. void enableViewZoomedThumbnail (bool enable = true);
  452. void enableViewShowThumbnailRectangle (bool enable = true);
  453. void enableThumbnailOptionActions (bool enable = true);
  454. void createThumbnailView ();
  455. void destroyThumbnailView ();
  456. void updateThumbnail ();
  457. /*
  458. * Image Menu
  459. */
  460. private:
  461. bool isSelectionActive () const;
  462. bool isTextSelection () const;
  463. TQString autoCropText () const;
  464. void setupImageMenuActions ();
  465. void enableImageMenuDocumentActions (bool enable = true);
  466. bool m_imageMenuDocumentActionsEnabled;
  467. TDEAction *m_actionResizeScale,
  468. *m_actionCrop, *m_actionAutoCrop,
  469. *m_actionFlip, *m_actionRotate, *m_actionSkew,
  470. *m_actionConvertToBlackAndWhite, *m_actionConvertToGrayscale,
  471. *m_actionMoreEffects,
  472. *m_actionInvertColors, *m_actionClear;
  473. private slots:
  474. void slotImageMenuUpdateDueToSelection ();
  475. public:
  476. kpColor backgroundColor (bool ofSelection = false) const;
  477. void addImageOrSelectionCommand (kpCommand *cmd,
  478. bool addSelCreateCmdIfSelAvail = true,
  479. bool addSelPullCmdIfSelAvail = true);
  480. private slots:
  481. void slotResizeScale ();
  482. public slots:
  483. void slotCrop ();
  484. private slots:
  485. void slotAutoCrop ();
  486. void slotFlip ();
  487. void slotRotate ();
  488. void slotSkew ();
  489. void slotConvertToBlackAndWhite ();
  490. void slotConvertToGrayscale ();
  491. void slotInvertColors ();
  492. void slotClear ();
  493. void slotMoreEffects ();
  494. /*
  495. * Settings Menu
  496. */
  497. private:
  498. void setupSettingsMenuActions ();
  499. void enableSettingsMenuDocumentActions (bool enable = true);
  500. TDEToggleAction *m_actionShowPath;
  501. TDEAction *m_actionKeyBindings, *m_actionConfigureToolbars, *m_actionConfigure;
  502. TDEToggleFullScreenAction *m_actionFullScreen;
  503. private slots:
  504. void slotFullScreen ();
  505. void slotEnableSettingsShowPath ();
  506. void slotShowPathToggled ();
  507. void slotKeyBindings ();
  508. void slotConfigureToolBars ();
  509. void slotNewToolBarConfig ();
  510. void slotConfigure ();
  511. /*
  512. * Status Bar
  513. */
  514. private:
  515. bool m_statusBarCreated;
  516. kpSqueezedTextLabel *m_statusBarMessageLabel;
  517. bool m_statusBarShapeLastPointsInitialised;
  518. TQPoint m_statusBarShapeLastStartPoint, m_statusBarShapeLastEndPoint;
  519. bool m_statusBarShapeLastSizeInitialised;
  520. TQSize m_statusBarShapeLastSize;
  521. enum
  522. {
  523. StatusBarItemMessage,
  524. StatusBarItemShapePoints,
  525. StatusBarItemShapeSize,
  526. StatusBarItemDocSize,
  527. StatusBarItemDocDepth,
  528. StatusBarItemZoom
  529. };
  530. void addPermanentStatusBarItem (int id, int maxTextLen);
  531. void createStatusBar ();
  532. private slots:
  533. void setStatusBarMessage (const TQString &message = TQString());
  534. void setStatusBarShapePoints (const TQPoint &startPoint = KP_INVALID_POINT,
  535. const TQPoint &endPoint = KP_INVALID_POINT);
  536. void setStatusBarShapeSize (const TQSize &size = KP_INVALID_SIZE);
  537. void setStatusBarDocSize (const TQSize &size = KP_INVALID_SIZE);
  538. void setStatusBarDocDepth (int depth = 0);
  539. void setStatusBarZoom (int zoom = 0);
  540. void recalculateStatusBarMessage ();
  541. void recalculateStatusBarShape ();
  542. void recalculateStatusBar ();
  543. /*
  544. * Text ToolBar
  545. */
  546. private:
  547. void setupTextToolBarActions ();
  548. void readAndApplyTextSettings ();
  549. public:
  550. void enableTextToolBarActions (bool enable = true);
  551. private slots:
  552. void slotTextFontFamilyChanged ();
  553. void slotTextFontSizeChanged ();
  554. void slotTextBoldChanged ();
  555. void slotTextItalicChanged ();
  556. void slotTextUnderlineChanged ();
  557. void slotTextStrikeThruChanged ();
  558. public:
  559. TDEToolBar *textToolBar ();
  560. bool isTextStyleBackgroundOpaque () const;
  561. kpTextStyle textStyle () const;
  562. void setTextStyle (const kpTextStyle &textStyle_);
  563. int settingTextStyle () const;
  564. private:
  565. TDEFontAction *m_actionTextFontFamily;
  566. TDEFontSizeAction *m_actionTextFontSize;
  567. TDEToggleAction *m_actionTextBold, *m_actionTextItalic,
  568. *m_actionTextUnderline, *m_actionTextStrikeThru;
  569. int m_settingTextStyle;
  570. TQString m_textOldFontFamily;
  571. int m_textOldFontSize;
  572. /*
  573. * Help Menu
  574. */
  575. private:
  576. void setupHelpMenuActions ();
  577. void enableHelpMenuDocumentActions (bool enable = true);
  578. private slots:
  579. void slotHelpTakingScreenshots ();
  580. void slotHelpTakingScreenshotsFollowLink (const TQString &link);
  581. private:
  582. // There is no need to maintain binary compatibility at this stage.
  583. // The d-pointer is just so that you can experiment without recompiling
  584. // the kitchen sink.
  585. class kpMainWindowPrivate *d;
  586. };
  587. #endif // KP_MAIN_WINDOW_H