diff options
author | Uray M. János <uray.janos@gmail.com> | 2012-08-17 07:29:20 +0200 |
---|---|---|
committer | Noel Power <noel.power@suse.com> | 2012-08-17 13:10:15 +0100 |
commit | 44861f2435a0c487d4fb5b196f7e4fe7f9569396 (patch) | |
tree | 2220c769287bdea3a82c6feb6b3ea09db81b6038 /basctl/source/basicide/layout.hxx | |
parent | 87a723da66a16293b1611e08991fbf6925144448 (diff) |
Object Catalog in Dialog Editor
Change-Id: Ia74faa1452a4200c28fbd7c63130700df0a70b24
Object Catalog in Dialog Editor
Change-Id: I97f2e0497b0e87cf630bba16dd98f9f7d0bb86e7
Diffstat (limited to 'basctl/source/basicide/layout.hxx')
-rw-r--r-- | basctl/source/basicide/layout.hxx | 125 |
1 files changed, 125 insertions, 0 deletions
diff --git a/basctl/source/basicide/layout.hxx b/basctl/source/basicide/layout.hxx new file mode 100644 index 000000000000..eca1b985c547 --- /dev/null +++ b/basctl/source/basicide/layout.hxx @@ -0,0 +1,125 @@ +/* -*- 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 BasicDockingWindow; +class IDEBaseWindow; +class SfxRequest; +class SfxItemSet; + +namespace basctl +{ + +// +// Layout -- the common base of ModulLayout and DialogLayout. +// Handles the splitting lines and the dockable windows. +// +class Layout: public Window, public utl::ConfigurationListener +{ +public: + void DockaWindow (DockingWindow*); + void ArrangeWindows (); + + virtual void Activating (IDEBaseWindow&); + virtual void Deactivating (); + virtual void ExecuteGlobal (SfxRequest&); + virtual void GetState (SfxItemSet&, unsigned nWhich); + virtual void UpdateDebug (bool bBasicStopped = false); + +protected: + Layout (Window* pParent); + virtual ~Layout (); + + void AddToLeft (BasicDockingWindow* pWin, Size const& rSize) { aLeftSide.Add(pWin, rSize); } + void AddToBottom (BasicDockingWindow* pWin, Size const& rSize) { aBottomSide.Add(pWin, rSize); } + +protected: + // Window: + virtual void Resize (); + virtual void DataChanged (DataChangedEvent const& rDCEvt); + // ConfigurationListener: + virtual void ConfigurationChanged (utl::ConfigurationBroadcaster*, sal_uInt32); + // new: + virtual void OnFirstSize (int nWidth, int nHeight); + +private: + // the main child window (either ModulWindow or DialogWindow) + IDEBaseWindow* pChild; + + // 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); + void Add (BasicDockingWindow*, Size const&); + 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 + std::vector<BasicDockingWindow*> vWindows; + // 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: */ |