xref: /aoo4110/main/sc/source/ui/inc/dwfunctr.hxx (revision b1cdbd2c)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef _SC_DWFUNCTR_HXX
24 #define _SC_DWFUNCTR_HXX
25 
26 #include <sfx2/childwin.hxx>
27 #include <sfx2/dockwin.hxx>
28 #include <svl/lstner.hxx>
29 #include <svtools/stdctrl.hxx>
30 
31 #ifndef _LSTBOX_HXX //autogen
32 #include <vcl/lstbox.hxx>
33 #endif
34 
35 #ifndef _IMAGEBTN_HXX //autogen
36 #include <vcl/button.hxx>
37 #endif
38 
39 #ifndef _COMBOBOX_HXX //autogen
40 #include <vcl/combobox.hxx>
41 #endif
42 #include "anyrefdg.hxx"
43 #include "global.hxx"		// ScAddress
44 #include "privsplt.hxx"
45 #include "funcdesc.hxx"
46 
47 #ifndef	LRU_MAX
48 #define LRU_MAX 10
49 #endif
50 /*************************************************************************
51 |*
52 |* Ableitung vom SfxChildWindow als "Behaelter" fuer Controller
53 |*
54 \************************************************************************/
55 
56 class ScFunctionChildWindow : public SfxChildWindow
57 {
58  public:
59 	ScFunctionChildWindow( Window*, sal_uInt16, SfxBindings*,
60 							SfxChildWinInfo* );
61 
62 	SFX_DECL_CHILDWINDOW(ScFunctionChildWindow);
63 };
64 
65 /*************************************************************************
66 |*
67 |* ScFuncDockWin
68 |*
69 \************************************************************************/
70 
71 class ScFunctionDockWin : public SfxDockingWindow, public SfxListener
72 {
73 
74 private:
75 	Timer				aTimer;
76 	ScPrivatSplit		aPrivatSplit;
77 	ListBox				aCatBox;
78 	ListBox				aFuncList;
79 	ListBox				aDDFuncList;
80 	ListBox*			pAllFuncList;
81 
82 	SfxChildAlignment	eSfxNewAlignment;
83 	SfxChildAlignment	eSfxOldAlignment;
84 	ImageButton			aInsertButton;
85 	FixedText			aFiFuncDesc;
86 	sal_uInt16				nLeftSlot;
87 	sal_uInt16				nRightSlot;
88 	sal_uLong				nMinWidth;
89 	sal_uLong				nMinHeight;
90 	Size				aOldSize;
91 	sal_Bool 				bSizeFlag;
92 	sal_Bool				bInit;
93 	short				nDockMode;
94 	Point				aSplitterInitPos;
95 	const ScFuncDesc*	pFuncDesc;
96 	sal_uInt16				nArgs;
97 	String**			pArgArr;
98 
99 
100 	const ScFuncDesc*   aLRUList[LRU_MAX];
101 
102 	void			UpdateFunctionList();
103 	void			UpdateLRUList();
104 	void			DoEnter(sal_Bool bOk); //@@ ???
105 	void			SetDescription();
106 	void			SetLeftRightSize();
107 	void			SetTopBottonSize();
108 	void			SetMyWidthLeRi(Size &aNewSize);
109 	void			SetMyHeightLeRi(Size &aNewSize);
110 	void			SetMyWidthToBo(Size &aNewSize);
111 	void			SetMyHeightToBo(Size &aNewSize);
112 	void			UseSplitterInitPos();
113 
114 					DECL_LINK( SetSelectionHdl, void* );
115 					DECL_LINK( SelHdl, ListBox* );
116 					DECL_LINK(SetSplitHdl,ScPrivatSplit*);
117 					DECL_LINK( TimerHdl, Timer*);
118 
119 protected:
120 
121 	virtual sal_Bool	Close();
122 	virtual void	Resize();
123 	virtual void	Resizing( Size& rSize );
124 	virtual void 	SetSize();
125 	virtual void	ToggleFloatingMode();
126 	virtual void	StateChanged( StateChangedType nStateChange );
127 
128 
129 	virtual SfxChildAlignment CheckAlignment(SfxChildAlignment,
130 								SfxChildAlignment eAlign);
131 
132 public:
133 					ScFunctionDockWin(	SfxBindings* pBindings,
134 										SfxChildWindow *pCW,
135 										Window* pParent,
136 										const ResId& rResId );
137 
138 					~ScFunctionDockWin();
139 
140     using SfxDockingWindow::Notify;
141 	virtual void 	Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
142 
SetSlotIDs(sal_uInt16 nLeft,sal_uInt16 nRight)143 	void			SetSlotIDs( sal_uInt16 nLeft, sal_uInt16 nRight )
144 						{ nLeftSlot = nLeft; nRightSlot = nRight; }
145 
146 	void			InitLRUList();
147 
148 	void			Initialize (SfxChildWinInfo* pInfo);
149 	virtual void    FillInfo(SfxChildWinInfo&) const;
150 };
151 
152 #endif
153 
154 
155