xref: /aoo41x/main/sw/source/ui/inc/inputwin.hxx (revision 1d2dbeb0)
1*1d2dbeb0SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*1d2dbeb0SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*1d2dbeb0SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*1d2dbeb0SAndrew Rist  * distributed with this work for additional information
6*1d2dbeb0SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*1d2dbeb0SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*1d2dbeb0SAndrew Rist  * "License"); you may not use this file except in compliance
9*1d2dbeb0SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*1d2dbeb0SAndrew Rist  *
11*1d2dbeb0SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*1d2dbeb0SAndrew Rist  *
13*1d2dbeb0SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*1d2dbeb0SAndrew Rist  * software distributed under the License is distributed on an
15*1d2dbeb0SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*1d2dbeb0SAndrew Rist  * KIND, either express or implied.  See the License for the
17*1d2dbeb0SAndrew Rist  * specific language governing permissions and limitations
18*1d2dbeb0SAndrew Rist  * under the License.
19*1d2dbeb0SAndrew Rist  *
20*1d2dbeb0SAndrew Rist  *************************************************************/
21*1d2dbeb0SAndrew Rist 
22*1d2dbeb0SAndrew Rist 
23cdf0e10cSrcweir #ifndef SW_INPUTWIN_HXX
24cdf0e10cSrcweir #define SW_INPUTWIN_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include <vcl/edit.hxx>
27cdf0e10cSrcweir #include <vcl/menu.hxx>
28cdf0e10cSrcweir #include <vcl/toolbox.hxx>
29cdf0e10cSrcweir 
30cdf0e10cSrcweir #include <sfx2/childwin.hxx>
31cdf0e10cSrcweir 
32cdf0e10cSrcweir class SwFldMgr;
33cdf0e10cSrcweir class SwWrtShell;
34cdf0e10cSrcweir class SwView;
35cdf0e10cSrcweir class SfxDispatcher;
36cdf0e10cSrcweir 
37cdf0e10cSrcweir //========================================================================
38cdf0e10cSrcweir class InputEdit : public Edit
39cdf0e10cSrcweir {
40cdf0e10cSrcweir public:
InputEdit(Window * pParent,WinBits nStyle)41cdf0e10cSrcweir 					InputEdit(Window* pParent, WinBits nStyle) :
42cdf0e10cSrcweir 						Edit(pParent , nStyle){}
43cdf0e10cSrcweir 
44cdf0e10cSrcweir 	void			UpdateRange(const String& aSel,
45cdf0e10cSrcweir 								const String& aTblName );
46cdf0e10cSrcweir 
47cdf0e10cSrcweir protected:
48cdf0e10cSrcweir 	virtual void 	KeyInput( const KeyEvent&  );
49cdf0e10cSrcweir };
50cdf0e10cSrcweir 
51cdf0e10cSrcweir //========================================================================
52cdf0e10cSrcweir 
53cdf0e10cSrcweir class SwInputWindow : public ToolBox
54cdf0e10cSrcweir {
55cdf0e10cSrcweir friend class InputEdit;
56cdf0e10cSrcweir 
57cdf0e10cSrcweir 	Edit			aPos;
58cdf0e10cSrcweir 	InputEdit		aEdit;
59cdf0e10cSrcweir 	PopupMenu		aPopMenu;
60cdf0e10cSrcweir 	SwFldMgr*		pMgr;
61cdf0e10cSrcweir 	SwWrtShell*		pWrtShell;
62cdf0e10cSrcweir 	SwView*			pView;
63cdf0e10cSrcweir     SfxBindings*    pBindings;
64cdf0e10cSrcweir 	String 			aAktTableName, sOldFml;
65cdf0e10cSrcweir     sal_Int32       m_nActionCount;
66cdf0e10cSrcweir 
67cdf0e10cSrcweir 	sal_Bool		bFirst : 1;  //Initialisierungen beim ersten Aufruf
68cdf0e10cSrcweir 	sal_Bool		bActive : 1; //fuer Hide/Show beim Dokumentwechsel
69cdf0e10cSrcweir 	sal_Bool		bIsTable : 1;
70cdf0e10cSrcweir 	sal_Bool		bDelSel : 1;
71cdf0e10cSrcweir     bool            m_bDoesUndo : 1;
72cdf0e10cSrcweir     bool            m_bResetUndo : 1;
73cdf0e10cSrcweir     bool            m_bCallUndo : 1;
74cdf0e10cSrcweir 
75cdf0e10cSrcweir     void CleanupUglyHackWithUndo();
76cdf0e10cSrcweir 
77cdf0e10cSrcweir 	void DelBoxCntnt();
78cdf0e10cSrcweir 	DECL_LINK( ModifyHdl, InputEdit* );
79cdf0e10cSrcweir 
80cdf0e10cSrcweir     using Window::IsActive;
81cdf0e10cSrcweir 
82cdf0e10cSrcweir protected:
83cdf0e10cSrcweir 	virtual void 	Resize();
84cdf0e10cSrcweir 	virtual void 	Click();
85cdf0e10cSrcweir 	DECL_LINK( MenuHdl, Menu * );
86cdf0e10cSrcweir     DECL_LINK( DropdownClickHdl, ToolBox* );
87cdf0e10cSrcweir 	void 			ApplyFormula();
88cdf0e10cSrcweir 	void 			CancelFormula();
89cdf0e10cSrcweir 
90cdf0e10cSrcweir public:
91cdf0e10cSrcweir                     SwInputWindow( Window* pParent, SfxBindings* pBindings );
92cdf0e10cSrcweir 	virtual			~SwInputWindow();
93cdf0e10cSrcweir 
94cdf0e10cSrcweir     virtual void    DataChanged( const DataChangedEvent& rDCEvt );
95cdf0e10cSrcweir 
96cdf0e10cSrcweir 	void			SelectHdl( ToolBox*);
97cdf0e10cSrcweir 
98cdf0e10cSrcweir 	void 			ShowWin();
99cdf0e10cSrcweir 
IsActive()100cdf0e10cSrcweir 	sal_Bool			IsActive(){ return bActive; };
101cdf0e10cSrcweir 
102cdf0e10cSrcweir 	DECL_LINK( SelTblCellsNotify, SwWrtShell * );
103cdf0e10cSrcweir 
104cdf0e10cSrcweir 	void 			SetFormula( const String& rFormula, sal_Bool bDelSel = sal_True );
GetView() const105cdf0e10cSrcweir 	const SwView*	GetView() const{return pView;}
106cdf0e10cSrcweir };
107cdf0e10cSrcweir 
108cdf0e10cSrcweir class SwInputChild : public SfxChildWindow
109cdf0e10cSrcweir {
110cdf0e10cSrcweir 	sal_Bool 			bObjVis;
111cdf0e10cSrcweir 	SfxDispatcher* 	pDispatch;
112cdf0e10cSrcweir public:
113cdf0e10cSrcweir 	SwInputChild( Window* ,
114cdf0e10cSrcweir 						sal_uInt16 nId,
115cdf0e10cSrcweir 						SfxBindings*,
116cdf0e10cSrcweir 						SfxChildWinInfo*  );
117cdf0e10cSrcweir 	~SwInputChild();
118cdf0e10cSrcweir 	SFX_DECL_CHILDWINDOW( SwInputChild );
SetFormula(const String & rFormula,sal_Bool bDelSel=sal_True)119cdf0e10cSrcweir 	void 			SetFormula( const String& rFormula, sal_Bool bDelSel = sal_True )
120cdf0e10cSrcweir 						{ ((SwInputWindow*)pWindow)->SetFormula(
121cdf0e10cSrcweir 									rFormula, bDelSel ); }
GetView() const122cdf0e10cSrcweir 	const SwView*	GetView() const{return ((SwInputWindow*)pWindow)->GetView();}
123cdf0e10cSrcweir 
124cdf0e10cSrcweir };
125cdf0e10cSrcweir 
126cdf0e10cSrcweir //==================================================================
127cdf0e10cSrcweir 
128cdf0e10cSrcweir #endif
129cdf0e10cSrcweir 
130