bump product version to 6.3.0.0.beta1
[LibreOffice.git] / sd / source / ui / inc / TabControl.hxx
blob4fd3c496343fd77aa4d4e7b4c31a03f5ee6792cb
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 INCLUDED_SD_SOURCE_UI_INC_TABCONTROL_HXX
21 #define INCLUDED_SD_SOURCE_UI_INC_TABCONTROL_HXX
23 #include <svtools/tabbar.hxx>
24 #include <vcl/transfer.hxx>
26 namespace sd {
28 /**
29 * TabControl-Class for page switch
32 class DrawViewShell;
34 class TabControl final
35 : public TabBar,
36 public DragSourceHelper,
37 public DropTargetHelper
39 public:
40 TabControl (DrawViewShell* pDrViewSh, vcl::Window* pParent);
41 virtual void dispose() override;
42 virtual ~TabControl() override;
44 /** Inform all listeners of this control that the current page has been
45 activated. Call this method after switching the current page and is
46 not done elsewhere (like when using page up/down keys).
48 void SendActivatePageEvent();
50 /** Inform all listeners of this control that the current page has been
51 deactivated. Call this method before switching the current page and
52 is not done elsewhere (like when using page up/down keys).
54 void SendDeactivatePageEvent();
56 private:
57 sal_uInt16 RrePageID;
58 DrawViewShell* pDrViewSh;
59 bool bInternalMove;
61 // TabBar
62 virtual void Select() override;
63 virtual void DoubleClick() override;
64 virtual void MouseButtonDown(const MouseEvent& rMEvt) override;
66 virtual void Command(const CommandEvent& rCEvt) override;
68 virtual bool StartRenaming() override;
69 virtual TabBarAllowRenamingReturnCode AllowRenaming() override;
70 virtual void EndRenaming() override;
72 virtual void ActivatePage() override;
73 virtual bool DeactivatePage() override;
75 // DragSourceHelper
76 virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel ) override;
78 // DropTargetHelper
79 virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt ) override;
80 virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt ) override;
82 // nested class to implement the TransferableHelper
83 class TabControlTransferable : public TransferableHelper
85 public:
86 explicit TabControlTransferable( TabControl& rParent ) :
87 mrParent( rParent ) {}
88 private:
90 TabControl& mrParent;
92 virtual ~TabControlTransferable() override;
94 virtual void AddSupportedFormats() override;
95 virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) override;
96 virtual void DragFinished( sal_Int8 nDropAction ) override;
100 friend class TabControl::TabControlTransferable;
102 void DragFinished();
104 using TabBar::StartDrag;
107 } // end of namespace sd
109 #endif
111 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */