merge the formfield patch from ooo-build
[ooovba.git] / dbaccess / source / ui / app / AppSwapWindow.hxx
blobd3d70ecd7249d104fd557f4ad84f0312929620e9
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: AppSwapWindow.hxx,v $
10 * $Revision: 1.8 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef DBAUI_APPSWAPWINDOW_HXX
31 #define DBAUI_APPSWAPWINDOW_HXX
33 #ifndef DBACCESS_TABLEDESIGN_ICLIPBOARDTEST_HXX
34 #include "IClipBoardTest.hxx"
35 #endif
36 #ifndef _SV_LSTBOX_HXX
37 #include <vcl/lstbox.hxx>
38 #endif
39 #ifndef DBAUI_APPICONCONTROL_HXX
40 #include "AppIconControl.hxx"
41 #endif
42 #ifndef DBAUI_APPELEMENTTYPE_HXX
43 #include "AppElementType.hxx"
44 #endif
46 namespace dbaui
48 class OAppBorderWindow;
49 //==================================================================
50 class OApplicationSwapWindow : public Window,
51 public IClipboardTest
53 OApplicationIconControl m_aIconControl;
54 ElementType m_eLastType;
55 OAppBorderWindow& m_rBorderWin;
57 void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
59 DECL_LINK( OnContainerSelectHdl, SvtIconChoiceCtrl* );
60 DECL_LINK( ChangeToLastSelected, void* );
61 protected:
62 virtual void DataChanged(const DataChangedEvent& rDCEvt);
63 public:
64 OApplicationSwapWindow( Window* _pParent, OAppBorderWindow& _rBorderWindow );
65 virtual ~OApplicationSwapWindow();
66 // window overloads
67 virtual void Resize();
70 inline sal_Bool isCutAllowed() { return sal_False; }
71 inline sal_Bool isCopyAllowed() { return sal_False; }
72 inline sal_Bool isPasteAllowed() { return sal_False; }
73 virtual sal_Bool hasChildPathFocus() { return HasChildPathFocus(); }
74 inline void copy() { }
75 inline void cut() { }
76 inline void paste() { }
78 inline ULONG GetEntryCount() const { return m_aIconControl.GetEntryCount(); }
79 inline SvxIconChoiceCtrlEntry* GetEntry( ULONG nPos ) const { return m_aIconControl.GetEntry(nPos); }
80 inline Rectangle GetBoundingBox( SvxIconChoiceCtrlEntry* pEntry ) const { return m_aIconControl.GetBoundingBox(pEntry); }
82 /** automatically creates mnemonics for the icon/texts in our left hand side panel
84 void createIconAutoMnemonics( MnemonicGenerator& _rMnemonics );
86 /** called to give the window the chance to intercept key events, while it has not
87 the focus
89 @return <TRUE/> if and only if the event has been handled, and should not
90 not be further processed
92 bool interceptKeyInput( const KeyEvent& _rEvent );
94 /// return the element of currently select entry
95 ElementType getElementType() const;
98 /** clears the selection in the icon choice control and calls the handler
100 void clearSelection();
102 /** changes the container which should be displayed. The select handler will also be called.
103 @param _eType
104 Which container to show.
106 void selectContainer(ElementType _eType);
108 private:
109 bool onContainerSelected( ElementType _eType );
111 // .............................................................
112 } // namespace dbaui
113 // .............................................................
114 #endif // DBAUI_APPSWAPWINDOW_HXX