LCOV - code coverage report
Current view: top level - usr/local/src/libreoffice/starmath/inc - ElementsDockingWindow.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 7 9 77.8 %
Date: 2013-07-09 Functions: 6 8 75.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 _ELEMENTSDOCKINGWINDOW_HXX_
      20             : #define _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             : public:
      33             :     Point mBoxLocation;
      34             :     Size  mBoxSize;
      35             : 
      36             :     SmElement(SmNodePointer pNode, OUString aText);
      37             :     virtual ~SmElement();
      38             : 
      39             :     SmNodePointer getNode();
      40           0 :     OUString      getText()
      41             :     {
      42           0 :         return maText;
      43             :     }
      44             : 
      45         234 :     virtual bool isSeparator()
      46             :     {
      47         234 :         return false;
      48             :     }
      49             : };
      50             : 
      51          68 : class SmElementSeparator : public SmElement
      52             : {
      53             : public:
      54             :     SmElementSeparator();
      55             : 
      56          26 :     virtual bool isSeparator()
      57             :     {
      58          26 :         return true;
      59             :     }
      60             : };
      61             : 
      62          17 : class SmElementsControl : public Control
      63             : {
      64             : 
      65             :     static const sal_uInt16 aUnaryBinaryOperatorsList[];
      66             :     static const sal_uInt16 aRelationsList[];
      67             :     static const sal_uInt16 aSetOperations[];
      68             :     static const sal_uInt16 aFunctions[];
      69             :     static const sal_uInt16 aOperators[];
      70             :     static const sal_uInt16 aAttributes[];
      71             :     static const sal_uInt16 aBrackets[];
      72             :     static const sal_uInt16 aFormats[];
      73             :     static const sal_uInt16 aOthers[];
      74             : 
      75             :     Link aSelectHdlLink;
      76             : 
      77             :     virtual void Paint(const Rectangle&);
      78             :     virtual void MouseButtonDown(const MouseEvent& rMEvt);
      79             :     virtual void MouseMove( const MouseEvent& rMEvt );
      80             : 
      81             :     typedef boost::shared_ptr<SmElement>    SmElementPointer;
      82             :     typedef std::vector< SmElementPointer > SmElementList;
      83             : 
      84             :     SmDocShell*   mpDocShell;
      85             :     SmFormat      maFormat;
      86             :     sal_uInt16    maCurrentSetId;
      87             :     SmElement*    mpCurrentElement;
      88             : 
      89             :     SmElementList maElementList;
      90             :     Size          maMaxElementDimensions;
      91             :     bool          mbVerticalMode;
      92             : 
      93             :     void addElement(OUString aElementVisual, OUString aElementSource);
      94             : 
      95             :     void addElements(const sal_uInt16 aElementsArray[], sal_uInt16 size);
      96             : 
      97             :     void addSeparator();
      98             : 
      99             :     void build();
     100             : 
     101             : public:
     102             :     SmElementsControl(Window *pParent, const ResId& rResId);
     103             : 
     104             :     void setElementSetId(sal_uInt16 aSetId);
     105             : 
     106             :     void setVerticalMode(bool bVertical);
     107             : 
     108          17 :     void SetSelectHdl(const Link& rLink)   { aSelectHdlLink = rLink; }
     109             : };
     110             : 
     111             : class SmElementsDockingWindow : public SfxDockingWindow
     112             : {
     113             :     static const sal_uInt16 aCategories[];
     114             : 
     115             :     SmElementsControl   maElementsControl;
     116             :     ListBox             maElementListBox;
     117             : 
     118             :     virtual void Resize();
     119             :     SmViewShell* GetView();
     120             : 
     121             :     DECL_LINK(SelectClickHdl, SmElement*);
     122             :     DECL_LINK(ElementSelectedHandle, ListBox*);
     123             : 
     124             : public:
     125             : 
     126             :     SmElementsDockingWindow( SfxBindings* pBindings,
     127             :                              SfxChildWindow* pChildWindow,
     128             :                              Window* pParent );
     129             :     ~SmElementsDockingWindow();
     130             : 
     131             :     virtual void EndDocking( const Rectangle& rReactangle, sal_Bool bFloatMode);
     132             : };
     133             : 
     134             : class SmElementsDockingWindowWrapper : public SfxChildWindow
     135             : {
     136             :     SFX_DECL_CHILDWINDOW_WITHID(SmElementsDockingWindowWrapper);
     137             : 
     138             : protected:
     139             :     SmElementsDockingWindowWrapper( Window* pParentWindow,
     140             :                                     sal_uInt16 nId,
     141             :                                     SfxBindings* pBindings,
     142             :                                     SfxChildWinInfo* pInfo );
     143             :     virtual ~SmElementsDockingWindowWrapper();
     144             : };
     145             : 
     146             : 
     147             : #endif // _SYMBOLDOCKINGWINDOW_HXX_
     148             : 
     149             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10