00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 #ifndef EDIT_HXX
00036 #define EDIT_HXX
00037
00038 #ifndef _SV_WINDOW_HXX //autogen
00039 #include <vcl/window.hxx>
00040 #endif
00041 #ifndef _SV_TIMER_HXX //autogen
00042 #include <vcl/timer.hxx>
00043 #endif
00044 #ifndef _TRANSFER_HXX
00045 #include <svtools/transfer.hxx>
00046 #endif
00047 #ifndef _MyEDITDATA_HXX //autogen
00048 #include <svx/editdata.hxx>
00049 #endif
00050 #ifndef INCLUDED_SVTOOLS_COLORCFG_HXX
00051 #include <svtools/colorcfg.hxx>
00052 #endif
00053
00054
00055
00056
00057
00058 class SmDocShell;
00059 class SmViewShell;
00060 class EditView;
00061 class EditEngine;
00062 class EditStatus;
00063 class ScrollBar;
00064 class ScrollBarBox;
00065 class DataChangedEvent;
00066 class Menu;
00067 class SmCmdBoxWindow;
00068 class SmEditAccessible;
00069 class CommandEvent;
00070
00071
00072
00073 void SmGetLeftSelectionPart(const ESelection aSelection,
00074 USHORT &nPara, USHORT &nPos);
00075
00076
00077
00078 class SmEditWindow : public Window, public DropTargetHelper
00079 {
00080 ::com::sun::star::uno::Reference<
00081 ::com::sun::star::accessibility::XAccessible > xAccessible;
00082 SmEditAccessible * pAccessible;
00083
00084 SmCmdBoxWindow &rCmdBox;
00085 EditView *pEditView;
00086 ScrollBar *pHScrollBar,
00087 *pVScrollBar;
00088 ScrollBarBox *pScrollBox;
00089 Timer aModifyTimer,
00090 aCursorMoveTimer;
00091 ESelection aOldSelection;
00092
00093 virtual void KeyInput(const KeyEvent& rKEvt);
00094 virtual void Command(const CommandEvent& rCEvt);
00095 DECL_LINK(MenuSelectHdl, Menu *);
00096 DECL_LINK(ModifyTimerHdl, Timer *);
00097 DECL_LINK(CursorMoveTimerHdl, Timer *);
00098
00099 virtual void DataChanged( const DataChangedEvent& );
00100 virtual void Resize();
00101 virtual void MouseMove(const MouseEvent &rEvt);
00102 virtual void MouseButtonUp(const MouseEvent &rEvt);
00103 virtual void MouseButtonDown(const MouseEvent &rEvt);
00104
00105 virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt );
00106 virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt );
00107 virtual void Paint(const Rectangle& rRect);
00108
00109 DECL_LINK(EditStatusHdl ,EditStatus *);
00110 DECL_LINK(ScrollHdl, ScrollBar *);
00111
00112 void CreateEditView();
00113
00114 Rectangle AdjustScrollBars();
00115 void SetScrollBarRanges();
00116 void InitScrollBars();
00117
00118 public:
00119 SmEditWindow( SmCmdBoxWindow &rMyCmdBoxWin );
00120 ~SmEditWindow();
00121
00122 SmDocShell * GetDoc();
00123 SmViewShell * GetView();
00124 EditView * GetEditView() { return pEditView; }
00125 EditEngine * GetEditEngine();
00126 SfxItemPool * GetEditEngineItemPool();
00127
00128
00129 virtual void SetText(const XubString &rText);
00130 virtual String GetText() const;
00131 virtual void GetFocus();
00132 virtual void LoseFocus();
00133
00134 ESelection GetSelection() const;
00135 void SetSelection(const ESelection &rSel);
00136
00137 BOOL IsEmpty() const;
00138 BOOL IsSelected() const;
00139 BOOL IsAllSelected() const;
00140 void Cut();
00141 void Copy();
00142 void Paste();
00143 void Delete();
00144 void SelectAll();
00145 void InsertText(const String &rText);
00146 void InsertCommand(USHORT nCommand);
00147 void MarkError(const Point &rPos);
00148 void SelNextMark();
00149 void SelPrevMark();
00150 BOOL HasMark(const String &rText) const;
00151
00152 void Flush();
00153 void DeleteEditView( SmViewShell &rView );
00154
00155 void ApplyColorConfigValues( const svtools::ColorConfig &rColorCfg );
00156
00157 BOOL HandleWheelCommands( const CommandEvent &rCEvt );
00158
00159
00160 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible();
00161
00162 using Window::GetAccessible;
00163 SmEditAccessible * GetAccessible() { return pAccessible; }
00164 };
00165
00166
00167 #endif
00168