LCOV - code coverage report
Current view: top level - starmath/inc - ElementsDockingWindow.hxx (source / functions) Hit Total Coverage
Test: commit e02a6cb2c3e2b23b203b422e4e0680877f232636 Lines: 0 10 0.0 %
Date: 2014-04-14 Functions: 0 7 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       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/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      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 .
      18             :  */
      19             : #ifndef INCLUDED_STARMATH_INC_ELEMENTSDOCKINGWINDOW_HXX
      20             : #define INCLUDED_STARMATH_INC_ELEMENTSDOCKINGWINDOW_HXX
      21             : 
      22             : #include <sfx2/dockwin.hxx>
      23             : #include <svx/dlgctrl.hxx>
      24             : 
      25             : #include <document.hxx>
      26             : #include <node.hxx>
      27             : 
      28             : class SmElement
      29             : {
      30             :     SmNodePointer   mpNode;
      31             :     OUString        maText;
      32             :     OUString        maHelpText;
      33             : public:
      34             :     Point mBoxLocation;
      35             :     Size  mBoxSize;
      36             : 
      37             :     SmElement(SmNodePointer pNode, const OUString& aText, const OUString& aHelpText);
      38             :     virtual ~SmElement();
      39             : 
      40             :     SmNodePointer getNode();
      41           0 :     OUString      getText()
      42             :     {
      43           0 :         return maText;
      44             :     }
      45             : 
      46           0 :     OUString getHelpText()
      47             :     {
      48           0 :         return maHelpText;
      49             :     }
      50             : 
      51           0 :     virtual bool isSeparator()
      52             :     {
      53           0 :         return false;
      54             :     }
      55             : };
      56             : 
      57           0 : class SmElementSeparator : public SmElement
      58             : {
      59             : public:
      60             :     SmElementSeparator();
      61             : 
      62           0 :     virtual bool isSeparator() SAL_OVERRIDE
      63             :     {
      64           0 :         return true;
      65             :     }
      66             : };
      67             : 
      68             : class SmElementsControl : public Control
      69             : {
      70             : 
      71             :     static const sal_uInt16 aUnaryBinaryOperatorsList[][2];
      72             :     static const sal_uInt16 aRelationsList[][2];
      73             :     static const sal_uInt16 aSetOperations[][2];
      74             :     static const sal_uInt16 aFunctions[][2];
      75             :     static const sal_uInt16 aOperators[][2];
      76             :     static const sal_uInt16 aAttributes[][2];
      77             :     static const sal_uInt16 aBrackets[][2];
      78             :     static const sal_uInt16 aFormats[][2];
      79             :     static const sal_uInt16 aOthers[][2];
      80             : 
      81             :     Link aSelectHdlLink;
      82             : 
      83             :     virtual void Paint(const Rectangle&) SAL_OVERRIDE;
      84             :     virtual void MouseButtonDown(const MouseEvent& rMEvt) SAL_OVERRIDE;
      85             :     virtual void MouseMove( const MouseEvent& rMEvt ) SAL_OVERRIDE;
      86             : 
      87             :     typedef boost::shared_ptr<SmElement>    SmElementPointer;
      88             :     typedef std::vector< SmElementPointer > SmElementList;
      89             : 
      90             :     SmDocShell*   mpDocShell;
      91             :     SmFormat      maFormat;
      92             :     sal_uInt16    maCurrentSetId;
      93             :     SmElement*    mpCurrentElement;
      94             : 
      95             :     SmElementList maElementList;
      96             :     Size          maMaxElementDimensions;
      97             :     bool          mbVerticalMode;
      98             : 
      99             :     void addElement(const OUString& aElementVisual, const OUString& aElementSource, const OUString& aHelpText);
     100             : 
     101             :     void addElements(const sal_uInt16 aElementsArray[][2], sal_uInt16 size);
     102             : 
     103             :     void addSeparator();
     104             : 
     105             :     void build();
     106             : 
     107             : public:
     108             :     SmElementsControl(Window *pParent, const ResId& rResId);
     109             :     virtual ~SmElementsControl();
     110             : 
     111             :     void setElementSetId(sal_uInt16 aSetId);
     112             : 
     113             :     void setVerticalMode(bool bVertical);
     114             : 
     115           0 :     void SetSelectHdl(const Link& rLink)   { aSelectHdlLink = rLink; }
     116             : };
     117             : 
     118             : class SmElementsDockingWindow : public SfxDockingWindow
     119             : {
     120             :     static const sal_uInt16 aCategories[];
     121             : 
     122             :     SmElementsControl   maElementsControl;
     123             :     ListBox             maElementListBox;
     124             : 
     125             :     virtual void Resize() SAL_OVERRIDE;
     126             :     SmViewShell* GetView();
     127             : 
     128             :     DECL_LINK(SelectClickHdl, SmElement*);
     129             :     DECL_LINK(ElementSelectedHandle, ListBox*);
     130             : 
     131             : public:
     132             : 
     133             :     SmElementsDockingWindow( SfxBindings* pBindings,
     134             :                              SfxChildWindow* pChildWindow,
     135             :                              Window* pParent );
     136             :     virtual ~SmElementsDockingWindow();
     137             : 
     138             :     virtual void EndDocking( const Rectangle& rReactangle, bool bFloatMode) SAL_OVERRIDE;
     139             :     virtual void ToggleFloatingMode() SAL_OVERRIDE;
     140             : };
     141             : 
     142             : class SmElementsDockingWindowWrapper : public SfxChildWindow
     143             : {
     144             :     SFX_DECL_CHILDWINDOW_WITHID(SmElementsDockingWindowWrapper);
     145             : 
     146             : protected:
     147             :     SmElementsDockingWindowWrapper( Window* pParentWindow,
     148             :                                     sal_uInt16 nId,
     149             :                                     SfxBindings* pBindings,
     150             :                                     SfxChildWinInfo* pInfo );
     151             :     virtual ~SmElementsDockingWindowWrapper();
     152             : };
     153             : 
     154             : 
     155             : #endif // _SYMBOLDOCKINGWINDOW_HXX_
     156             : 
     157             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10