xref: /trunk/main/dbaccess/source/ui/app/AppSwapWindow.hxx (revision 914d351e5f5b84e4342a86d6ab8d4aca7308b9bd)
1*2e2212a7SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*2e2212a7SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*2e2212a7SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*2e2212a7SAndrew Rist  * distributed with this work for additional information
6*2e2212a7SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*2e2212a7SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*2e2212a7SAndrew Rist  * "License"); you may not use this file except in compliance
9*2e2212a7SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*2e2212a7SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*2e2212a7SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*2e2212a7SAndrew Rist  * software distributed under the License is distributed on an
15*2e2212a7SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*2e2212a7SAndrew Rist  * KIND, either express or implied.  See the License for the
17*2e2212a7SAndrew Rist  * specific language governing permissions and limitations
18*2e2212a7SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*2e2212a7SAndrew Rist  *************************************************************/
21*2e2212a7SAndrew Rist 
22*2e2212a7SAndrew Rist 
23cdf0e10cSrcweir #ifndef DBAUI_APPSWAPWINDOW_HXX
24cdf0e10cSrcweir #define DBAUI_APPSWAPWINDOW_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #ifndef DBACCESS_TABLEDESIGN_ICLIPBOARDTEST_HXX
27cdf0e10cSrcweir #include "IClipBoardTest.hxx"
28cdf0e10cSrcweir #endif
29cdf0e10cSrcweir #ifndef _SV_LSTBOX_HXX
30cdf0e10cSrcweir #include <vcl/lstbox.hxx>
31cdf0e10cSrcweir #endif
32cdf0e10cSrcweir #ifndef DBAUI_APPICONCONTROL_HXX
33cdf0e10cSrcweir #include "AppIconControl.hxx"
34cdf0e10cSrcweir #endif
35cdf0e10cSrcweir #ifndef DBAUI_APPELEMENTTYPE_HXX
36cdf0e10cSrcweir #include "AppElementType.hxx"
37cdf0e10cSrcweir #endif
38cdf0e10cSrcweir 
39cdf0e10cSrcweir namespace dbaui
40cdf0e10cSrcweir {
41cdf0e10cSrcweir     class OAppBorderWindow;
42cdf0e10cSrcweir     //==================================================================
43cdf0e10cSrcweir     class OApplicationSwapWindow :  public Window,
44cdf0e10cSrcweir                                     public IClipboardTest
45cdf0e10cSrcweir     {
46cdf0e10cSrcweir         OApplicationIconControl             m_aIconControl;
47cdf0e10cSrcweir         ElementType                         m_eLastType;
48cdf0e10cSrcweir         OAppBorderWindow&                   m_rBorderWin;
49cdf0e10cSrcweir 
50cdf0e10cSrcweir         void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
51cdf0e10cSrcweir 
52cdf0e10cSrcweir         DECL_LINK( OnContainerSelectHdl,    SvtIconChoiceCtrl* );
53cdf0e10cSrcweir         DECL_LINK( ChangeToLastSelected, void* );
54cdf0e10cSrcweir     protected:
55cdf0e10cSrcweir         virtual void DataChanged(const DataChangedEvent& rDCEvt);
56cdf0e10cSrcweir     public:
57cdf0e10cSrcweir         OApplicationSwapWindow( Window* _pParent, OAppBorderWindow& _rBorderWindow );
58cdf0e10cSrcweir         virtual ~OApplicationSwapWindow();
59cdf0e10cSrcweir         // window overloads
60cdf0e10cSrcweir         virtual void Resize();
61cdf0e10cSrcweir 
62cdf0e10cSrcweir 
isCutAllowed()63cdf0e10cSrcweir         inline sal_Bool isCutAllowed()      { return sal_False; }
isCopyAllowed()64cdf0e10cSrcweir         inline sal_Bool isCopyAllowed()     { return sal_False; }
isPasteAllowed()65cdf0e10cSrcweir         inline sal_Bool isPasteAllowed()    { return sal_False; }
hasChildPathFocus()66cdf0e10cSrcweir         virtual sal_Bool hasChildPathFocus() { return HasChildPathFocus(); }
copy()67cdf0e10cSrcweir         inline void copy()  { }
cut()68cdf0e10cSrcweir         inline void cut()   { }
paste()69cdf0e10cSrcweir         inline void paste() { }
70cdf0e10cSrcweir 
GetEntryCount() const71cdf0e10cSrcweir         inline sal_uLong                    GetEntryCount() const { return m_aIconControl.GetEntryCount(); }
GetEntry(sal_uLong nPos) const72cdf0e10cSrcweir         inline SvxIconChoiceCtrlEntry*  GetEntry( sal_uLong nPos ) const { return m_aIconControl.GetEntry(nPos); }
GetBoundingBox(SvxIconChoiceCtrlEntry * pEntry) const73cdf0e10cSrcweir         inline Rectangle                GetBoundingBox( SvxIconChoiceCtrlEntry* pEntry ) const { return m_aIconControl.GetBoundingBox(pEntry); }
74cdf0e10cSrcweir 
75cdf0e10cSrcweir         /** automatically creates mnemonics for the icon/texts in our left hand side panel
76cdf0e10cSrcweir         */
77cdf0e10cSrcweir         void    createIconAutoMnemonics( MnemonicGenerator& _rMnemonics );
78cdf0e10cSrcweir 
79cdf0e10cSrcweir         /** called to give the window the chance to intercept key events, while it has not
80cdf0e10cSrcweir             the focus
81cdf0e10cSrcweir 
82cdf0e10cSrcweir             @return <TRUE/> if and only if the event has been handled, and should not
83cdf0e10cSrcweir                 not be further processed
84cdf0e10cSrcweir         */
85cdf0e10cSrcweir         bool    interceptKeyInput( const KeyEvent& _rEvent );
86cdf0e10cSrcweir 
87cdf0e10cSrcweir         /// return the element of currently select entry
88cdf0e10cSrcweir         ElementType getElementType() const;
89cdf0e10cSrcweir 
90cdf0e10cSrcweir 
91cdf0e10cSrcweir         /** clears the selection in the icon choice control and calls the handler
92cdf0e10cSrcweir         */
93cdf0e10cSrcweir         void clearSelection();
94cdf0e10cSrcweir 
95cdf0e10cSrcweir         /** changes the container which should be displayed. The select handler will also be called.
96cdf0e10cSrcweir             @param  _eType
97cdf0e10cSrcweir                 Which container to show.
98cdf0e10cSrcweir         */
99cdf0e10cSrcweir         void selectContainer(ElementType _eType);
100cdf0e10cSrcweir 
101cdf0e10cSrcweir     private:
102cdf0e10cSrcweir         bool onContainerSelected( ElementType _eType );
103cdf0e10cSrcweir     };
104cdf0e10cSrcweir // .............................................................
105cdf0e10cSrcweir } // namespace dbaui
106cdf0e10cSrcweir // .............................................................
107cdf0e10cSrcweir #endif // DBAUI_APPSWAPWINDOW_HXX
108