LCOV - code coverage report
Current view: top level - sc/source/ui/inc - condformatdlgentry.hxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 0 15 0.0 %
Date: 2014-11-03 Functions: 0 22 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             : 
      10             : #ifndef INCLUDED_SC_SOURCE_UI_INC_CONDFORMATDLGENTRY_HXX
      11             : #define INCLUDED_SC_SOURCE_UI_INC_CONDFORMATDLGENTRY_HXX
      12             : 
      13             : #include "colorscale.hxx"
      14             : #include "conditio.hxx"
      15             : #include <formula/funcutl.hxx>
      16             : 
      17             : #include <svl/lstner.hxx>
      18             : 
      19             : class ScIconSetFrmtDataEntry;
      20             : class ScCondFormatDlg;
      21             : 
      22             : namespace condformat {
      23             : 
      24             : namespace entry {
      25             : 
      26             : enum ScCondFrmtEntryType
      27             : {
      28             :     CONDITION,
      29             :     FORMULA,
      30             :     COLORSCALE2,
      31             :     COLORSCALE3,
      32             :     DATABAR,
      33             :     ICONSET,
      34             :     DATE
      35             : };
      36             : 
      37             : }
      38             : 
      39             : }
      40             : 
      41             : class ScCondFrmtEntry : public Control
      42             : {
      43             : private:
      44             :     bool mbActive;
      45             : 
      46             :     Link maClickHdl;
      47             : 
      48             :     //general ui elements
      49             :     FixedText maFtCondNr;
      50             :     FixedText maFtCondition;
      51             : 
      52             :     sal_Int32 mnIndex;
      53             :     OUString maStrCondition;
      54             : protected:
      55             :     ListBox maLbType;
      56             : 
      57             :     ScDocument* mpDoc;
      58             :     ScAddress maPos;
      59             : 
      60             :     DECL_LINK( EdModifyHdl, Edit* );
      61             : 
      62             :     void Select();
      63             :     void Deselect();
      64             : 
      65             :     virtual OUString GetExpressionString() = 0;
      66             : 
      67             : public:
      68             :     ScCondFrmtEntry( vcl::Window* pParent, ScDocument* pDoc, const ScAddress& rPos );
      69             :     virtual ~ScCondFrmtEntry();
      70             : 
      71             :     virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
      72             : 
      73           0 :     bool IsSelected() const { return mbActive;}
      74             :     void SetIndex(sal_Int32 nIndex);
      75             :     sal_Int32 GetIndex() const { return mnIndex; }
      76             :     void SetHeight();
      77             : 
      78             :     virtual ScFormatEntry* GetEntry() const = 0;
      79             :     virtual void SetActive() = 0;
      80             :     virtual void SetInactive() = 0;
      81             : 
      82             :     virtual condformat::entry::ScCondFrmtEntryType GetType() = 0;
      83             : };
      84             : 
      85           0 : class ScConditionFrmtEntry : public ScCondFrmtEntry, public SfxListener
      86             : {
      87             :     //cond format ui elements
      88             :     ListBox maLbCondType;
      89             :     formula::RefEdit maEdVal1;
      90             :     formula::RefEdit maEdVal2;
      91             :     FixedText maFtStyle;
      92             :     ListBox maLbStyle;
      93             :     SvxFontPrevWindow maWdPreview;
      94             :     bool mbIsInStyleCreate;
      95             : 
      96             :     ScFormatEntry* createConditionEntry() const;
      97             : 
      98             :     virtual OUString GetExpressionString() SAL_OVERRIDE;
      99             :     void Init(ScCondFormatDlg* pDialogParent);
     100             :     DECL_LINK( StyleSelectHdl, void* );
     101             :     DECL_LINK( ConditionTypeSelectHdl, void* );
     102             : 
     103             : public:
     104             :     ScConditionFrmtEntry( vcl::Window* pParent, ScDocument* pDoc, ScCondFormatDlg* pDialogParent,
     105             :             const ScAddress& rPos, const ScCondFormatEntry* pFormatEntry = NULL );
     106             : 
     107             :     virtual ScFormatEntry* GetEntry() const SAL_OVERRIDE;
     108             :     virtual void SetActive() SAL_OVERRIDE;
     109             :     virtual void SetInactive() SAL_OVERRIDE;
     110             : 
     111             :     virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SAL_OVERRIDE;
     112             :     using ScCondFrmtEntry::Notify;
     113             : 
     114           0 :     virtual condformat::entry::ScCondFrmtEntryType GetType() SAL_OVERRIDE { return condformat::entry::CONDITION; }
     115             : };
     116             : 
     117           0 : class ScFormulaFrmtEntry : public ScCondFrmtEntry
     118             : {
     119             :     FixedText maFtStyle;
     120             :     ListBox maLbStyle;
     121             :     SvxFontPrevWindow maWdPreview;
     122             :     formula::RefEdit maEdFormula;
     123             : 
     124             :     ScFormatEntry* createFormulaEntry() const;
     125             :     virtual OUString GetExpressionString() SAL_OVERRIDE;
     126             :     void Init(ScCondFormatDlg* pDialogParent);
     127             : 
     128             :     DECL_LINK( StyleSelectHdl, void* );
     129             : 
     130             : public:
     131             :     ScFormulaFrmtEntry( vcl::Window* pParent, ScDocument* PDoc, ScCondFormatDlg* pDialogParent, const ScAddress& rPos, const ScCondFormatEntry* pFormatEntry = NULL );
     132             : 
     133             :     virtual ScFormatEntry* GetEntry() const SAL_OVERRIDE;
     134             :     virtual void SetActive() SAL_OVERRIDE;
     135             :     virtual void SetInactive() SAL_OVERRIDE;
     136           0 :     virtual condformat::entry::ScCondFrmtEntryType GetType() SAL_OVERRIDE { return condformat::entry::FORMULA; }
     137             : };
     138             : 
     139           0 : class ScColorScale2FrmtEntry : public ScCondFrmtEntry
     140             : {
     141             : 
     142             :     //color format ui elements
     143             :     ListBox maLbColorFormat;
     144             : 
     145             :     //color scale ui elements
     146             :     ListBox maLbEntryTypeMin;
     147             :     ListBox maLbEntryTypeMax;
     148             : 
     149             :     Edit maEdMin;
     150             :     Edit maEdMax;
     151             : 
     152             :     ColorListBox maLbColMin;
     153             :     ColorListBox maLbColMax;
     154             : 
     155             :     ScFormatEntry* createColorscaleEntry() const;
     156             : 
     157             :     virtual OUString GetExpressionString() SAL_OVERRIDE;
     158             :     void Init();
     159             : 
     160             :     DECL_LINK( EntryTypeHdl, ListBox* );
     161             : public:
     162             :     ScColorScale2FrmtEntry( vcl::Window* pParent, ScDocument* pDoc, const ScAddress& rPos, const ScColorScaleFormat* pFormat = NULL );
     163             :     virtual ScFormatEntry* GetEntry() const SAL_OVERRIDE;
     164             :     virtual void SetActive() SAL_OVERRIDE;
     165             :     virtual void SetInactive() SAL_OVERRIDE;
     166           0 :     virtual condformat::entry::ScCondFrmtEntryType GetType() SAL_OVERRIDE { return condformat::entry::COLORSCALE2; }
     167             : };
     168             : 
     169           0 : class ScColorScale3FrmtEntry : public ScCondFrmtEntry
     170             : {
     171             : 
     172             :     //color format ui elements
     173             :     ListBox maLbColorFormat;
     174             : 
     175             :     //color scale ui elements
     176             :     ListBox maLbEntryTypeMin;
     177             :     ListBox maLbEntryTypeMiddle;
     178             :     ListBox maLbEntryTypeMax;
     179             : 
     180             :     Edit maEdMin;
     181             :     Edit maEdMiddle;
     182             :     Edit maEdMax;
     183             : 
     184             :     ColorListBox maLbColMin;
     185             :     ColorListBox maLbColMiddle;
     186             :     ColorListBox maLbColMax;
     187             : 
     188             :     ScFormatEntry* createColorscaleEntry() const;
     189             : 
     190             :     virtual OUString GetExpressionString() SAL_OVERRIDE;
     191             :     void Init();
     192             : 
     193             :     DECL_LINK( EntryTypeHdl, ListBox* );
     194             : public:
     195             :     ScColorScale3FrmtEntry( vcl::Window* pParent, ScDocument* pDoc, const ScAddress& rPos, const ScColorScaleFormat* pFormat = NULL );
     196             :     virtual ScFormatEntry* GetEntry() const SAL_OVERRIDE;
     197             :     virtual void SetActive() SAL_OVERRIDE;
     198             :     virtual void SetInactive() SAL_OVERRIDE;
     199           0 :     virtual condformat::entry::ScCondFrmtEntryType GetType() SAL_OVERRIDE { return condformat::entry::COLORSCALE3; }
     200             : };
     201             : 
     202           0 : class ScDataBarFrmtEntry : public ScCondFrmtEntry
     203             : {
     204             :     //color format ui elements
     205             :     ListBox maLbColorFormat;
     206             : 
     207             :     //data bar ui elements
     208             :     ListBox maLbDataBarMinType;
     209             :     ListBox maLbDataBarMaxType;
     210             :     Edit maEdDataBarMin;
     211             :     Edit maEdDataBarMax;
     212             : 
     213             :     PushButton maBtOptions;
     214             : 
     215             :     boost::scoped_ptr<ScDataBarFormatData> mpDataBarData;
     216             : 
     217             :     ScFormatEntry* createDatabarEntry() const;
     218             : 
     219             :     virtual OUString GetExpressionString() SAL_OVERRIDE;
     220             :     void Init();
     221             : 
     222             :     DECL_LINK( OptionBtnHdl, void* );
     223             :     DECL_LINK( DataBarTypeSelectHdl, void* );
     224             : public:
     225             :     ScDataBarFrmtEntry( vcl::Window* pParemt, ScDocument* pDoc, const ScAddress& rPos, const ScDataBarFormat* pFormat = NULL );
     226             :     virtual ScFormatEntry* GetEntry() const SAL_OVERRIDE;
     227             :     virtual void SetActive() SAL_OVERRIDE;
     228             :     virtual void SetInactive() SAL_OVERRIDE;
     229             : 
     230           0 :     virtual condformat::entry::ScCondFrmtEntryType GetType() SAL_OVERRIDE { return condformat::entry::DATABAR; }
     231             : };
     232             : 
     233           0 : class ScDateFrmtEntry : public ScCondFrmtEntry, public SfxListener
     234             : {
     235             : public:
     236             :     ScDateFrmtEntry( vcl::Window* pParent, ScDocument* pDoc, const ScCondDateFormatEntry* pFormat = NULL );
     237             :     virtual ScFormatEntry* GetEntry() const SAL_OVERRIDE;
     238             :     virtual void SetActive() SAL_OVERRIDE;
     239             :     virtual void SetInactive() SAL_OVERRIDE;
     240           0 :     virtual condformat::entry::ScCondFrmtEntryType GetType() SAL_OVERRIDE { return condformat::entry::DATE; }
     241             : 
     242             :     virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SAL_OVERRIDE;
     243             :     using ScCondFrmtEntry::Notify;
     244             : protected:
     245             :     virtual OUString GetExpressionString() SAL_OVERRIDE;
     246             : 
     247             : private:
     248             :     void Init();
     249             : 
     250             :     DECL_LINK( StyleSelectHdl, void* );
     251             : 
     252             :     ListBox maLbDateEntry;
     253             :     FixedText maFtStyle;
     254             :     ListBox maLbStyle;
     255             :     SvxFontPrevWindow maWdPreview;
     256             : 
     257             :     bool mbIsInStyleCreate;
     258             : };
     259             : 
     260           0 : class ScIconSetFrmtEntry : public ScCondFrmtEntry
     261             : {
     262             :     //color format ui elements
     263             :     ListBox maLbColorFormat;
     264             : 
     265             :     // icon set ui elements
     266             :     ListBox maLbIconSetType;
     267             : 
     268             :     typedef boost::ptr_vector<ScIconSetFrmtDataEntry> ScIconSetFrmtDataEntriesType;
     269             :     ScIconSetFrmtDataEntriesType maEntries;
     270             : 
     271             :     virtual OUString GetExpressionString() SAL_OVERRIDE;
     272             : 
     273             :     void Init();
     274             : 
     275             :     DECL_LINK( IconSetTypeHdl, void* );
     276             : 
     277             : public:
     278             :     ScIconSetFrmtEntry( vcl::Window* pParent, ScDocument* pDoc, const ScAddress& rPos, const ScIconSetFormat* pFormat = NULL );
     279             :     virtual ScFormatEntry* GetEntry() const SAL_OVERRIDE;
     280             :     virtual void SetActive() SAL_OVERRIDE;
     281             :     virtual void SetInactive() SAL_OVERRIDE;
     282           0 :     virtual condformat::entry::ScCondFrmtEntryType GetType() SAL_OVERRIDE { return condformat::entry::ICONSET; }
     283             : };
     284             : 
     285             : #endif
     286             : 
     287             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10