1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef SD_TAB_CONTROL_HXX
21 #define SD_TAB_CONTROL_HXX
23 #include <svtools/tabbar.hxx>
24 #include <svtools/transfer.hxx>
29 * TabControl-Class for page switch
36 public DragSourceHelper
,
37 public DropTargetHelper
40 TabControl (DrawViewShell
* pDrViewSh
, ::Window
* pParent
);
41 virtual ~TabControl (void);
43 /** Inform all listeners of this control that the current page has been
44 activated. Call this method after switching the current page and is
45 not done elsewhere (like when using page up/down keys).
47 void SendActivatePageEvent (void);
49 /** Inform all listeners of this control that the current page has been
50 deactivated. Call this method before switching the current page and
51 is not done elsewhere (like when using page up/down keys).
53 void SendDeactivatePageEvent (void);
56 DrawViewShell
* pDrViewSh
;
57 sal_Bool bInternalMove
;
60 virtual void Select();
61 virtual void DoubleClick();
62 virtual void MouseButtonDown(const MouseEvent
& rMEvt
);
64 virtual void Command(const CommandEvent
& rCEvt
);
66 virtual long StartRenaming();
67 virtual long AllowRenaming();
68 virtual void EndRenaming();
70 virtual void ActivatePage();
71 virtual long DeactivatePage();
74 virtual void StartDrag( sal_Int8 nAction
, const Point
& rPosPixel
);
77 virtual sal_Int8
AcceptDrop( const AcceptDropEvent
& rEvt
);
78 virtual sal_Int8
ExecuteDrop( const ExecuteDropEvent
& rEvt
);
80 DECL_LINK(DeactivatePageHdl
, void*);
83 // nested class to implement the TransferableHelper
84 class TabControlTransferable
: public TransferableHelper
87 TabControlTransferable( TabControl
& rParent
) :
88 mrParent( rParent
) {}
93 virtual ~TabControlTransferable();
95 virtual void AddSupportedFormats();
96 virtual sal_Bool
GetData( const ::com::sun::star::datatransfer::DataFlavor
& rFlavor
);
97 virtual void DragFinished( sal_Int8 nDropAction
);
101 friend class TabControl::TabControlTransferable
;
103 void DragFinished( sal_Int8 nDropAction
);
106 using TabBar::StartDrag
;
109 } // end of namespace sd
113 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */