2012-08-17 07:29:20 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
|
|
/*
|
|
|
|
* 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 .
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef BASCTL_LAYOUT_HXX
|
|
|
|
#define BASCTL_LAYOUT_HXX
|
|
|
|
|
|
|
|
#include <vcl/window.hxx>
|
|
|
|
#include <vcl/split.hxx>
|
|
|
|
#include <unotools/options.hxx>
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
#include <boost/shared_ptr.hpp>
|
|
|
|
|
|
|
|
class DockingWindow;
|
|
|
|
class SfxRequest;
|
|
|
|
class SfxItemSet;
|
|
|
|
|
|
|
|
namespace basctl
|
|
|
|
{
|
|
|
|
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
class DockingWindow;
|
|
|
|
class BaseWindow;
|
|
|
|
|
2012-08-17 07:29:20 +02:00
|
|
|
//
|
|
|
|
// Layout -- the common base of ModulLayout and DialogLayout.
|
|
|
|
// Handles the splitting lines and the dockable windows.
|
|
|
|
//
|
2012-08-17 13:10:45 +01:00
|
|
|
class Layout: public Window
|
2012-08-17 07:29:20 +02:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
void DockaWindow (DockingWindow*);
|
|
|
|
void ArrangeWindows ();
|
|
|
|
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
virtual void Activating (BaseWindow&);
|
2012-08-17 07:29:20 +02:00
|
|
|
virtual void Deactivating ();
|
2012-08-31 12:44:47 +02:00
|
|
|
virtual void ExecuteGlobal (SfxRequest&) { }
|
2012-08-17 13:10:45 +01:00
|
|
|
virtual void GetState (SfxItemSet&, unsigned nWhich) = 0;
|
|
|
|
virtual void UpdateDebug (bool bBasicStopped ) = 0;
|
2012-08-17 07:29:20 +02:00
|
|
|
|
|
|
|
protected:
|
|
|
|
Layout (Window* pParent);
|
|
|
|
virtual ~Layout ();
|
|
|
|
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
void AddToLeft (DockingWindow* pWin, Size const& rSize) { aLeftSide.Add(pWin, rSize); }
|
|
|
|
void AddToBottom (DockingWindow* pWin, Size const& rSize) { aBottomSide.Add(pWin, rSize); }
|
2012-09-05 19:41:42 +02:00
|
|
|
void Remove (DockingWindow*);
|
|
|
|
bool HasSize () const { return !bFirstSize; }
|
2012-08-17 07:29:20 +02:00
|
|
|
|
|
|
|
protected:
|
|
|
|
// Window:
|
|
|
|
virtual void Resize ();
|
|
|
|
virtual void DataChanged (DataChangedEvent const& rDCEvt);
|
|
|
|
// new:
|
2012-09-07 10:31:53 +02:00
|
|
|
virtual void OnFirstSize (long nWidth, long nHeight) = 0;
|
2012-08-17 07:29:20 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
// the main child window (either ModulWindow or DialogWindow)
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
BaseWindow* pChild;
|
2012-08-17 07:29:20 +02:00
|
|
|
|
|
|
|
// when this window has at first (nonempty) size
|
|
|
|
bool bFirstSize;
|
|
|
|
|
|
|
|
// horizontal or vertical splitted strip
|
|
|
|
class SplittedSide
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
enum Side {Right, Top, Left, Bottom};
|
|
|
|
SplittedSide (Layout*, Side);
|
Basic IDE: namespace basctl
Now all names in basctl are in namespace 'basctl'.
There were lots of names that included the word 'Basic' or 'BasicIDE' in
it, e.g. BasicIDEData, BasicDocumentEntry, BasicTreeListBox,
BasicIDEModule, IDEBaseWindow etc. This information is now stored in the
namespace name, so the names could be shortened: basctl::DocumentEntry,
basctl::TreeListBox, basctl::Module, basctl::BaseWindow etc.
Some other minor changes:
* LibInfos, LibInfoItem, LibInfoKey ->
LibInfos, LibInfos::Item, LibInfos::Key
* The header guards are now uniformly BASCTL_FILENAME_HXX, instead of
e.g. _FILENAME_HXX, which is undefined behaviour because of the '_'.
* namespace BasicIDE, BasicIDEGlobals, basicide -> namespace basctl
* BASICIDE_TYPE_MODULE, ... -> basctl::TYPE_MODULE, ...
Change-Id: I2a9b493562d0d8a2510d569798fbe9e1161b7c9b
Reviewed-on: https://gerrit.libreoffice.org/501
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
2012-08-25 12:43:27 +02:00
|
|
|
void Add (DockingWindow*, Size const&);
|
2012-09-05 19:41:42 +02:00
|
|
|
void Remove (DockingWindow*);
|
2012-08-17 07:29:20 +02:00
|
|
|
bool IsEmpty () const;
|
2012-09-07 10:31:53 +02:00
|
|
|
long GetSize () const;
|
2012-08-17 07:29:20 +02:00
|
|
|
void ArrangeIn (Rectangle const&);
|
|
|
|
|
|
|
|
private:
|
|
|
|
// the layout window
|
|
|
|
Layout& rLayout;
|
|
|
|
// horizontal or vertical strip?
|
|
|
|
bool bVertical;
|
|
|
|
// lower (top or left) or higher (bottom or right) strip?
|
|
|
|
bool bLower;
|
|
|
|
// rectangle to move in
|
|
|
|
Rectangle aRect;
|
|
|
|
// size (width or height)
|
2012-09-07 10:31:53 +02:00
|
|
|
long nSize;
|
2012-08-17 07:29:20 +02:00
|
|
|
// the main splitting line
|
|
|
|
Splitter aSplitter;
|
2012-09-07 10:01:42 +02:00
|
|
|
// the dockable windows (and some data)
|
|
|
|
struct Item
|
|
|
|
{
|
|
|
|
// pointer to the dockable window
|
|
|
|
DockingWindow* pWin;
|
|
|
|
// starting and ending position in the strip
|
|
|
|
// They may be different from the actual window position, because
|
|
|
|
// the window may fill the space of the adjacent currently
|
|
|
|
// non-docking windows, but this change is not stored in these
|
|
|
|
// variables. These change only when the splitter lines are moved.
|
2012-09-07 10:31:53 +02:00
|
|
|
long nStartPos, nEndPos;
|
2012-09-07 10:01:42 +02:00
|
|
|
// splitter line window before the window
|
|
|
|
// (the first one is always nullptr)
|
|
|
|
boost::shared_ptr<Splitter> pSplit;
|
|
|
|
};
|
|
|
|
std::vector<Item> vItems;
|
2012-08-17 07:29:20 +02:00
|
|
|
private:
|
2012-09-07 10:31:53 +02:00
|
|
|
Point MakePoint (long, long) const;
|
|
|
|
Size MakeSize (long, long) const;
|
2012-09-07 10:01:42 +02:00
|
|
|
private:
|
|
|
|
static bool IsDocking (DockingWindow const&);
|
2012-08-17 07:29:20 +02:00
|
|
|
private:
|
|
|
|
DECL_LINK(SplitHdl, Splitter*);
|
|
|
|
void CheckMarginsFor (Splitter*);
|
|
|
|
void InitSplitter (Splitter&);
|
|
|
|
} aLeftSide, aBottomSide;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace basctl
|
|
|
|
|
|
|
|
#endif // BASCTL_LAYOUT_HXX
|
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|