Update ooo320-m1
[ooovba.git] / sd / source / ui / notes / EditWindow.hxx
blob230bfb5f081fb9754c0d7d6bf1a727c833c26a23
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: EditWindow.hxx,v $
10 * $Revision: 1.5 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef SD_EDIT_WINDOW_HXX
32 #define SD_EDIT_WINDOW_HXX
34 #include <vcl/window.hxx>
35 #include <svtools/transfer.hxx>
36 #include <vcl/timer.hxx>
37 #include <svx/editdata.hxx>
38 #include <svtools/colorcfg.hxx>
40 class EditEngine;
41 class EditStatus;
42 class EditView;
43 class Menu;
44 class ScrollBar;
45 class ScrollBarBox;
46 class SfxItemPool;
47 class Timer;
50 namespace sd { namespace notes {
52 class EditWindow
53 : public Window,
54 public DropTargetHelper
56 public:
57 EditWindow (Window* pParentWindow, SfxItemPool* pItemPool);
58 ~EditWindow (void);
60 void InsertText (const String &rText);
62 using Window::GetText;
63 private:
64 EditView* mpEditView;
65 EditEngine* mpEditEngine;
66 SfxItemPool* mpEditEngineItemPool;
67 ScrollBar* mpHorizontalScrollBar;
68 ScrollBar* mpVerticalScrollBar;
69 ScrollBarBox* mpScrollBox;
70 Timer maModifyTimer;
71 Timer maCursorMoveTimer;
72 ESelection maOldSelection;
74 virtual void KeyInput(const KeyEvent& rKEvt);
75 virtual void Command(const CommandEvent& rCEvt);
76 DECL_LINK(MenuSelectHdl, Menu *);
78 virtual void DataChanged( const DataChangedEvent& );
79 virtual void Resize();
80 virtual void MouseMove(const MouseEvent &rEvt);
81 virtual void MouseButtonUp(const MouseEvent &rEvt);
82 virtual void MouseButtonDown(const MouseEvent &rEvt);
84 virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt );
85 virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt );
86 virtual void Paint(const Rectangle& rRect);
88 DECL_LINK(EditStatusHdl ,EditStatus *);
89 DECL_LINK(ScrollHdl, ScrollBar *);
91 void CreateEditView();
93 Rectangle AdjustScrollBars();
94 void SetScrollBarRanges();
95 void InitScrollBars();
97 // SmDocShell * GetDoc();
98 // SmViewShell * GetView();
99 EditView* GetEditView (void);
100 EditEngine* GetEditEngine (void);
101 EditEngine* CreateEditEngine (void);
103 // Window
104 virtual void SetText(const XubString &rText);
105 virtual XubString GetText();
106 virtual void GetFocus();
107 virtual void LoseFocus();
109 ESelection GetSelection() const;
110 void SetSelection(const ESelection &rSel);
112 BOOL IsEmpty() const;
113 BOOL IsSelected() const;
114 BOOL IsAllSelected() const;
115 void Cut();
116 void Copy();
117 void Paste();
118 void Delete();
119 void SelectAll();
120 void MarkError(const Point &rPos);
121 void SelNextMark();
122 void SelPrevMark();
123 BOOL HasMark(const String &rText) const;
125 void ApplyColorConfigValues( const svtools::ColorConfig &rColorCfg );
128 } } // end of namespace ::sd::notes
130 #endif