Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : : #ifndef SW_INPUTWIN_HXX
29 : : #define SW_INPUTWIN_HXX
30 : :
31 : : #include <vcl/edit.hxx>
32 : : #include <vcl/menu.hxx>
33 : : #include <vcl/toolbox.hxx>
34 : :
35 : : #include <sfx2/childwin.hxx>
36 : :
37 : : class SwFldMgr;
38 : : class SwWrtShell;
39 : : class SwView;
40 : : class SfxDispatcher;
41 : :
42 : : //========================================================================
43 [ # # ]: 0 : class InputEdit : public Edit
44 : : {
45 : : public:
46 : 0 : InputEdit(Window* pParent, WinBits nStyle) :
47 : 0 : Edit(pParent , nStyle){}
48 : :
49 : : void UpdateRange(const String& aSel,
50 : : const String& aTblName );
51 : :
52 : : protected:
53 : : virtual void KeyInput( const KeyEvent& );
54 : : };
55 : :
56 : : //========================================================================
57 : :
58 : : class SwInputWindow : public ToolBox
59 : : {
60 : : friend class InputEdit;
61 : :
62 : : Edit aPos;
63 : : InputEdit aEdit;
64 : : PopupMenu aPopMenu;
65 : : SwFldMgr* pMgr;
66 : : SwWrtShell* pWrtShell;
67 : : SwView* pView;
68 : : SfxBindings* pBindings;
69 : : String aAktTableName, sOldFml;
70 : :
71 : : sal_Bool bFirst : 1; // initialisations at first call
72 : : sal_Bool bActive : 1; // for hide/show when switching documents
73 : : sal_Bool bIsTable : 1;
74 : : sal_Bool bDelSel : 1;
75 : : bool m_bDoesUndo : 1;
76 : : bool m_bResetUndo : 1;
77 : : bool m_bCallUndo : 1;
78 : :
79 : : void CleanupUglyHackWithUndo();
80 : :
81 : : void DelBoxCntnt();
82 : : DECL_LINK( ModifyHdl, void* );
83 : :
84 : : using Window::IsActive;
85 : :
86 : : protected:
87 : : virtual void Resize();
88 : : virtual void Click();
89 : : DECL_LINK( MenuHdl, Menu * );
90 : : DECL_LINK( DropdownClickHdl, void* );
91 : : void ApplyFormula();
92 : : void CancelFormula();
93 : :
94 : : public:
95 : : SwInputWindow( Window* pParent, SfxBindings* pBindings );
96 : : virtual ~SwInputWindow();
97 : :
98 : : virtual void DataChanged( const DataChangedEvent& rDCEvt );
99 : :
100 : : void SelectHdl( ToolBox*);
101 : :
102 : : void ShowWin();
103 : :
104 : : sal_Bool IsActive(){ return bActive; };
105 : :
106 : : DECL_LINK( SelTblCellsNotify, SwWrtShell * );
107 : :
108 : : void SetFormula( const String& rFormula, sal_Bool bDelSel = sal_True );
109 : 0 : const SwView* GetView() const{return pView;}
110 : : };
111 : :
112 : : class SwInputChild : public SfxChildWindow
113 : : {
114 : : sal_Bool bObjVis;
115 : : SfxDispatcher* pDispatch;
116 : : public:
117 : : SwInputChild( Window* ,
118 : : sal_uInt16 nId,
119 : : SfxBindings*,
120 : : SfxChildWinInfo* );
121 : : ~SwInputChild();
122 : : SFX_DECL_CHILDWINDOW_WITHID( SwInputChild );
123 : 0 : void SetFormula( const String& rFormula, sal_Bool bDelSel = sal_True )
124 : : { ((SwInputWindow*)pWindow)->SetFormula(
125 : 0 : rFormula, bDelSel ); }
126 : 0 : const SwView* GetView() const{return ((SwInputWindow*)pWindow)->GetView();}
127 : :
128 : : };
129 : :
130 : : //==================================================================
131 : :
132 : : #endif
133 : :
134 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|