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-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-08-17 07:29:20 +02:00
|
|
|
|
|
|
|
protected:
|
|
|
|
// Window:
|
|
|
|
virtual void Resize ();
|
|
|
|
virtual void DataChanged (DataChangedEvent const& rDCEvt);
|
|
|
|
// new:
|
2012-08-17 13:10:45 +01:00
|
|
|
virtual void OnFirstSize (int nWidth, int 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-08-17 07:29:20 +02:00
|
|
|
bool IsEmpty () const;
|
|
|
|
int GetSize () const;
|
|
|
|
void ArrangeIn (Rectangle const&);
|
|
|
|
|
|
|
|
private:
|
|
|
|
// the layout window
|
|
|
|
Layout& rLayout;
|
|
|
|
// ArrangeIn() is called at first time?
|
|
|
|
bool bFirstArrange;
|
|
|
|
// 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)
|
|
|
|
int nSize;
|
|
|
|
// last position (between Add()s)
|
|
|
|
int nLastPos;
|
|
|
|
// the main splitting line
|
|
|
|
Splitter aSplitter;
|
|
|
|
// the dockable windows
|
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
|
|
|
std::vector<DockingWindow*> vWindows;
|
2012-08-17 07:29:20 +02:00
|
|
|
// splitting lines between the docking windows (vWindows.size() - 1)
|
|
|
|
std::vector<boost::shared_ptr<Splitter> > vSplitters;
|
|
|
|
|
|
|
|
private:
|
|
|
|
Point MakePoint (int, int) const;
|
|
|
|
Size MakeSize (int, int) const;
|
|
|
|
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: */
|