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 DBAUI_APPSWAPWINDOW_HXX 24 #define DBAUI_APPSWAPWINDOW_HXX 25 26 #ifndef DBACCESS_TABLEDESIGN_ICLIPBOARDTEST_HXX 27 #include "IClipBoardTest.hxx" 28 #endif 29 #ifndef _SV_LSTBOX_HXX 30 #include <vcl/lstbox.hxx> 31 #endif 32 #ifndef DBAUI_APPICONCONTROL_HXX 33 #include "AppIconControl.hxx" 34 #endif 35 #ifndef DBAUI_APPELEMENTTYPE_HXX 36 #include "AppElementType.hxx" 37 #endif 38 39 namespace dbaui 40 { 41 class OAppBorderWindow; 42 //================================================================== 43 class OApplicationSwapWindow : public Window, 44 public IClipboardTest 45 { 46 OApplicationIconControl m_aIconControl; 47 ElementType m_eLastType; 48 OAppBorderWindow& m_rBorderWin; 49 50 void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground ); 51 52 DECL_LINK( OnContainerSelectHdl, SvtIconChoiceCtrl* ); 53 DECL_LINK( ChangeToLastSelected, void* ); 54 protected: 55 virtual void DataChanged(const DataChangedEvent& rDCEvt); 56 public: 57 OApplicationSwapWindow( Window* _pParent, OAppBorderWindow& _rBorderWindow ); 58 virtual ~OApplicationSwapWindow(); 59 // window overloads 60 virtual void Resize(); 61 62 isCutAllowed()63 inline sal_Bool isCutAllowed() { return sal_False; } isCopyAllowed()64 inline sal_Bool isCopyAllowed() { return sal_False; } isPasteAllowed()65 inline sal_Bool isPasteAllowed() { return sal_False; } hasChildPathFocus()66 virtual sal_Bool hasChildPathFocus() { return HasChildPathFocus(); } copy()67 inline void copy() { } cut()68 inline void cut() { } paste()69 inline void paste() { } 70 GetEntryCount() const71 inline sal_uLong GetEntryCount() const { return m_aIconControl.GetEntryCount(); } GetEntry(sal_uLong nPos) const72 inline SvxIconChoiceCtrlEntry* GetEntry( sal_uLong nPos ) const { return m_aIconControl.GetEntry(nPos); } GetBoundingBox(SvxIconChoiceCtrlEntry * pEntry) const73 inline Rectangle GetBoundingBox( SvxIconChoiceCtrlEntry* pEntry ) const { return m_aIconControl.GetBoundingBox(pEntry); } 74 75 /** automatically creates mnemonics for the icon/texts in our left hand side panel 76 */ 77 void createIconAutoMnemonics( MnemonicGenerator& _rMnemonics ); 78 79 /** called to give the window the chance to intercept key events, while it has not 80 the focus 81 82 @return <TRUE/> if and only if the event has been handled, and should not 83 not be further processed 84 */ 85 bool interceptKeyInput( const KeyEvent& _rEvent ); 86 87 /// return the element of currently select entry 88 ElementType getElementType() const; 89 90 91 /** clears the selection in the icon choice control and calls the handler 92 */ 93 void clearSelection(); 94 95 /** changes the container which should be displayed. The select handler will also be called. 96 @param _eType 97 Which container to show. 98 */ 99 void selectContainer(ElementType _eType); 100 101 private: 102 bool onContainerSelected( ElementType _eType ); 103 }; 104 // ............................................................. 105 } // namespace dbaui 106 // ............................................................. 107 #endif // DBAUI_APPSWAPWINDOW_HXX 108 109