2010-10-27 12:53:26 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-06-21 14:30:25 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2004-01-20 10:45:32 +00:00
|
|
|
|
2013-10-23 22:38:46 +02:00
|
|
|
#ifndef INCLUDED_SD_SOURCE_UI_INC_TABCONTROL_HXX
|
|
|
|
#define INCLUDED_SD_SOURCE_UI_INC_TABCONTROL_HXX
|
2004-01-20 10:45:32 +00:00
|
|
|
|
|
|
|
#include <svtools/tabbar.hxx>
|
|
|
|
#include <svtools/transfer.hxx>
|
|
|
|
|
|
|
|
namespace sd {
|
|
|
|
|
2013-03-13 17:55:26 +01:00
|
|
|
/**
|
|
|
|
* TabControl-Class for page switch
|
|
|
|
*/
|
2004-01-20 10:45:32 +00:00
|
|
|
|
|
|
|
class DrawViewShell;
|
|
|
|
|
2017-10-25 15:53:56 +02:00
|
|
|
class TabControl final
|
2004-01-20 10:45:32 +00:00
|
|
|
: public TabBar,
|
|
|
|
public DragSourceHelper,
|
|
|
|
public DropTargetHelper
|
|
|
|
{
|
|
|
|
public:
|
2014-09-23 11:20:40 +02:00
|
|
|
TabControl (DrawViewShell* pDrViewSh, vcl::Window* pParent);
|
2016-06-03 17:15:20 +02:00
|
|
|
virtual void dispose() override;
|
2016-09-13 13:09:01 +02:00
|
|
|
virtual ~TabControl() override;
|
2004-01-20 10:45:32 +00:00
|
|
|
|
|
|
|
/** Inform all listeners of this control that the current page has been
|
|
|
|
activated. Call this method after switching the current page and is
|
|
|
|
not done elsewhere (like when using page up/down keys).
|
|
|
|
*/
|
2015-04-14 12:44:47 +02:00
|
|
|
void SendActivatePageEvent();
|
2004-01-20 10:45:32 +00:00
|
|
|
|
|
|
|
/** Inform all listeners of this control that the current page has been
|
|
|
|
deactivated. Call this method before switching the current page and
|
|
|
|
is not done elsewhere (like when using page up/down keys).
|
|
|
|
*/
|
2015-04-14 12:44:47 +02:00
|
|
|
void SendDeactivatePageEvent();
|
2004-01-20 10:45:32 +00:00
|
|
|
|
2017-10-25 15:53:56 +02:00
|
|
|
private:
|
|
|
|
sal_uInt16 RrePageID;
|
|
|
|
DrawViewShell* pDrViewSh;
|
2014-04-24 10:52:02 +02:00
|
|
|
bool bInternalMove;
|
2004-01-20 10:45:32 +00:00
|
|
|
|
|
|
|
// TabBar
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void Select() override;
|
|
|
|
virtual void DoubleClick() override;
|
|
|
|
virtual void MouseButtonDown(const MouseEvent& rMEvt) override;
|
2004-01-20 10:45:32 +00:00
|
|
|
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void Command(const CommandEvent& rCEvt) override;
|
2004-01-20 10:45:32 +00:00
|
|
|
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual bool StartRenaming() override;
|
|
|
|
virtual TabBarAllowRenamingReturnCode AllowRenaming() override;
|
|
|
|
virtual void EndRenaming() override;
|
2004-01-20 10:45:32 +00:00
|
|
|
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void ActivatePage() override;
|
|
|
|
virtual bool DeactivatePage() override;
|
2004-01-20 10:45:32 +00:00
|
|
|
|
|
|
|
// DragSourceHelper
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel ) override;
|
2004-01-20 10:45:32 +00:00
|
|
|
|
|
|
|
// DropTargetHelper
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt ) override;
|
|
|
|
virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt ) override;
|
2004-01-20 10:45:32 +00:00
|
|
|
|
|
|
|
// nested class to implement the TransferableHelper
|
|
|
|
class TabControlTransferable : public TransferableHelper
|
|
|
|
{
|
|
|
|
public:
|
2015-10-25 17:33:13 +02:00
|
|
|
explicit TabControlTransferable( TabControl& rParent ) :
|
2004-01-20 10:45:32 +00:00
|
|
|
mrParent( rParent ) {}
|
|
|
|
private:
|
|
|
|
|
|
|
|
TabControl& mrParent;
|
|
|
|
|
2016-09-13 13:09:01 +02:00
|
|
|
virtual ~TabControlTransferable() override;
|
2004-01-20 10:45:32 +00:00
|
|
|
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void AddSupportedFormats() override;
|
|
|
|
virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) override;
|
|
|
|
virtual void DragFinished( sal_Int8 nDropAction ) override;
|
2004-01-20 10:45:32 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
friend class TabControl::TabControlTransferable;
|
|
|
|
|
2017-05-02 16:23:46 +02:00
|
|
|
void DragFinished();
|
2004-01-20 10:45:32 +00:00
|
|
|
|
2006-12-12 16:38:34 +00:00
|
|
|
using TabBar::StartDrag;
|
2004-01-20 10:45:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // end of namespace sd
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2010-10-27 12:53:26 +01:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|