2010-10-14 08:30:41 +02:00
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2011-03-31 10:05:04 +02:00
/*
* 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 .
*/
2014-06-03 10:01:18 +02:00
# ifndef INCLUDED_SW_SOURCE_UIBASE_INC_SWUIIDXMRK_HXX
# define INCLUDED_SW_SOURCE_UIBASE_INC_SWUIIDXMRK_HXX
2004-05-10 15:31:05 +00:00
# include <com/sun/star/container/XNameAccess.hpp>
# include <sfx2/basedlgs.hxx>
# include <svx/stddlg.hxx>
2012-10-24 14:10:20 +01:00
# include <vcl/button.hxx>
# include <vcl/combobox.hxx>
2004-05-10 15:31:05 +00:00
# include <vcl/field.hxx>
2012-10-24 14:10:20 +01:00
# include <vcl/fixed.hxx>
2004-05-10 15:31:05 +00:00
# include <vcl/group.hxx>
2012-10-24 14:10:20 +01:00
# include <vcl/layout.hxx>
# include <vcl/lstbox.hxx>
2004-05-10 15:31:05 +00:00
# include <sfx2/childwin.hxx>
# include "toxe.hxx"
# include <svtools/stdctrl.hxx>
# include <com/sun/star/i18n/XExtendedIndexEntrySupplier.hpp>
class SwWrtShell ;
class SwTOXMgr ;
class SwTOXMark ;
2014-05-25 21:26:51 -04:00
// insert mark for index entry
2004-05-10 15:31:05 +00:00
class SwIndexMarkFloatDlg ;
class SwIndexMarkModalDlg ;
2010-10-13 10:32:10 +05:30
2012-10-24 14:10:20 +01:00
class SwIndexMarkPane
2004-05-10 15:31:05 +00:00
{
2012-10-24 14:10:20 +01:00
Dialog & m_rDialog ;
2004-05-10 15:31:05 +00:00
friend class SwIndexMarkFloatDlg ;
friend class SwIndexMarkModalDlg ;
2015-03-09 14:29:30 +02:00
VclPtr < VclFrame > m_pFrame ;
VclPtr < FixedText > m_pTypeFT ;
VclPtr < ListBox > m_pTypeDCB ;
VclPtr < PushButton > m_pNewBT ;
VclPtr < Edit > m_pEntryED ;
VclPtr < FixedText > m_pPhoneticFT0 ;
VclPtr < Edit > m_pPhoneticED0 ;
VclPtr < FixedText > m_pKey1FT ;
VclPtr < ComboBox > m_pKey1DCB ;
VclPtr < FixedText > m_pPhoneticFT1 ;
VclPtr < Edit > m_pPhoneticED1 ;
VclPtr < FixedText > m_pKey2FT ;
VclPtr < ComboBox > m_pKey2DCB ;
VclPtr < FixedText > m_pPhoneticFT2 ;
VclPtr < Edit > m_pPhoneticED2 ;
VclPtr < FixedText > m_pLevelFT ;
VclPtr < NumericField > m_pLevelNF ;
VclPtr < CheckBox > m_pMainEntryCB ;
VclPtr < CheckBox > m_pApplyToAllCB ;
VclPtr < CheckBox > m_pSearchCaseSensitiveCB ;
VclPtr < CheckBox > m_pSearchCaseWordOnlyCB ;
VclPtr < PushButton > m_pOKBT ;
VclPtr < CloseButton > m_pCloseBT ;
VclPtr < PushButton > m_pDelBT ;
VclPtr < PushButton > m_pPrevSameBT ;
VclPtr < PushButton > m_pNextSameBT ;
VclPtr < PushButton > m_pPrevBT ;
VclPtr < PushButton > m_pNextBT ;
2004-05-10 15:31:05 +00:00
2013-10-08 14:59:26 +02:00
OUString aOrgStr ;
2014-04-25 14:00:35 +02:00
bool bDel ;
bool bNewMark ;
bool bSelected ;
2004-05-10 15:31:05 +00:00
2014-04-25 14:00:35 +02:00
bool bPhoneticED0_ChangedByUser ;
bool bPhoneticED1_ChangedByUser ;
bool bPhoneticED2_ChangedByUser ;
2004-05-10 15:31:05 +00:00
LanguageType nLangForPhoneticReading ; //Language of current text used for phonetic reading proposal
2014-04-25 14:00:35 +02:00
bool bIsPhoneticReadingEnabled ; //this value states whether phonetic reading is enabled in principle dependent of global cjk settings and language of current entry
2004-05-10 15:31:05 +00:00
com : : sun : : star : : uno : : Reference < com : : sun : : star : : i18n : : XExtendedIndexEntrySupplier >
xExtendedIndexEntrySupplier ;
SwTOXMgr * pTOXMgr ;
SwWrtShell * pSh ;
void Apply ( ) ;
void InitControls ( ) ;
void InsertMark ( ) ;
void UpdateMark ( ) ;
DECL_LINK ( InsertHdl , Button * ) ;
2012-03-01 18:00:32 +01:00
DECL_LINK ( CloseHdl , void * ) ;
DECL_LINK ( DelHdl , void * ) ;
DECL_LINK ( NextHdl , void * ) ;
DECL_LINK ( NextSameHdl , void * ) ;
DECL_LINK ( PrevHdl , void * ) ;
DECL_LINK ( PrevSameHdl , void * ) ;
2004-05-10 15:31:05 +00:00
DECL_LINK ( ModifyHdl , ListBox * pBox = 0 ) ;
DECL_LINK ( KeyDCBModifyHdl , ComboBox * ) ;
2012-03-01 18:00:32 +01:00
DECL_LINK ( NewUserIdxHdl , void * ) ;
2004-05-10 15:31:05 +00:00
DECL_LINK ( SearchTypeHdl , CheckBox * ) ;
DECL_LINK ( PhoneticEDModifyHdl , Edit * ) ;
//this method updates the values from 'nLangForPhoneticReading' and 'bIsPhoneticReadingEnabled'
//it needs to be called ones if this dialog is opened to create a new entry (in InitControls),
//or otherwise it has to be called for each changed TOXMark (in UpdateDialog)
void UpdateLanguageDependenciesForPhoneticReading ( ) ;
2013-10-08 14:59:26 +02:00
OUString GetDefaultPhoneticReading ( const OUString & rText ) ;
2004-05-10 15:31:05 +00:00
void UpdateKeyBoxes ( ) ;
void UpdateDialog ( ) ;
void InsertUpdate ( ) ;
2012-10-24 14:10:20 +01:00
void Activate ( ) ;
2004-05-10 15:31:05 +00:00
public :
2012-10-24 14:10:20 +01:00
SwIndexMarkPane ( Dialog & rDialog ,
2014-04-25 14:00:35 +02:00
bool bNewDlg ,
2012-10-24 14:10:20 +01:00
SwWrtShell & rWrtShell ) ;
Dialog & GetDialog ( ) { return m_rDialog ; }
2004-05-10 15:31:05 +00:00
2012-10-24 14:10:20 +01:00
~ SwIndexMarkPane ( ) ;
2004-05-10 15:31:05 +00:00
void ReInitDlg ( SwWrtShell & rWrtShell , SwTOXMark * pCurTOXMark = 0 ) ;
2014-04-25 14:00:35 +02:00
bool IsTOXType ( const OUString & rName )
2012-10-24 14:10:20 +01:00
{ return LISTBOX_ENTRY_NOTFOUND ! = m_pTypeDCB - > GetEntryPos ( rName ) ; }
2004-05-10 15:31:05 +00:00
} ;
class SwIndexMarkFloatDlg : public SfxModelessDialog
{
2012-10-24 14:10:20 +01:00
SwIndexMarkPane m_aContent ;
2014-03-27 18:12:18 +01:00
virtual void Activate ( ) SAL_OVERRIDE ;
2004-05-10 15:31:05 +00:00
public :
2014-04-25 14:00:35 +02:00
SwIndexMarkFloatDlg ( SfxBindings * pBindings ,
2004-05-10 15:31:05 +00:00
SfxChildWindow * pChild ,
2014-09-23 11:20:40 +02:00
vcl : : Window * pParent ,
2014-04-25 14:00:35 +02:00
SfxChildWinInfo * pInfo ,
bool bNew = true ) ;
2004-05-10 15:31:05 +00:00
void ReInitDlg ( SwWrtShell & rWrtShell ) ;
} ;
class SwIndexMarkModalDlg : public SvxStandardDialog
{
2012-10-24 14:10:20 +01:00
SwIndexMarkPane m_aContent ;
2004-05-10 15:31:05 +00:00
public :
2014-09-23 11:20:40 +02:00
SwIndexMarkModalDlg ( vcl : : Window * pParent , SwWrtShell & rSh , SwTOXMark * pCurTOXMark ) ;
2004-05-10 15:31:05 +00:00
2014-03-27 18:12:18 +01:00
virtual void Apply ( ) SAL_OVERRIDE ;
2004-05-10 15:31:05 +00:00
void ReInitDlg ( SwWrtShell & rWrtShell ) ;
} ;
class SwAuthMarkModalDlg ;
2010-10-13 10:32:10 +05:30
2012-10-19 18:20:58 +01:00
class SwAuthorMarkPane
2004-05-10 15:31:05 +00:00
{
2012-10-19 18:20:58 +01:00
Dialog & m_rDialog ;
2014-04-25 14:00:35 +02:00
static bool bIsFromComponent ;
2004-05-10 15:31:05 +00:00
friend class SwAuthMarkModalDlg ;
friend class SwAuthMarkFloatDlg ;
2015-03-09 14:29:30 +02:00
VclPtr < RadioButton > m_pFromComponentRB ;
VclPtr < RadioButton > m_pFromDocContentRB ;
VclPtr < FixedText > m_pAuthorFI ;
VclPtr < FixedText > m_pTitleFI ;
VclPtr < Edit > m_pEntryED ;
VclPtr < ListBox > m_pEntryLB ;
VclPtr < PushButton > m_pActionBT ;
VclPtr < CloseButton > m_pCloseBT ;
VclPtr < PushButton > m_pCreateEntryPB ;
VclPtr < PushButton > m_pEditEntryPB ;
2004-05-10 15:31:05 +00:00
2014-04-25 14:00:35 +02:00
bool bNewEntry ;
bool bBibAccessInitialized ;
2004-05-10 15:31:05 +00:00
SwWrtShell * pSh ;
2013-10-08 14:59:26 +02:00
OUString m_sColumnTitles [ AUTH_FIELD_END ] ;
OUString m_sFields [ AUTH_FIELD_END ] ;
2004-05-10 15:31:05 +00:00
2013-10-08 14:59:26 +02:00
OUString m_sCreatedEntry [ AUTH_FIELD_END ] ;
2004-05-10 15:31:05 +00:00
: : com : : sun : : star : : uno : : Reference < : : com : : sun : : star : : container : : XNameAccess > xBibAccess ;
2012-03-01 18:00:32 +01:00
DECL_LINK ( InsertHdl , void * ) ;
DECL_LINK ( CloseHdl , void * ) ;
2004-05-10 15:31:05 +00:00
DECL_LINK ( CreateEntryHdl , PushButton * ) ;
DECL_LINK ( CompEntryHdl , ListBox * ) ;
DECL_LINK ( ChangeSourceHdl , RadioButton * ) ;
DECL_LINK ( IsEntryAllowedHdl , Edit * ) ;
DECL_LINK ( EditModifyHdl , Edit * ) ;
void InitControls ( ) ;
2012-10-19 18:20:58 +01:00
void Activate ( ) ;
2004-05-10 15:31:05 +00:00
public :
2012-10-19 18:20:58 +01:00
SwAuthorMarkPane ( Dialog & rDialog ,
2014-04-25 14:00:35 +02:00
bool bNew = true ) ;
2004-05-10 15:31:05 +00:00
void ReInitDlg ( SwWrtShell & rWrtShell ) ;
} ;
class SwAuthMarkFloatDlg : public SfxModelessDialog
{
2012-10-19 18:20:58 +01:00
SwAuthorMarkPane m_aContent ;
2014-03-27 18:12:18 +01:00
virtual void Activate ( ) SAL_OVERRIDE ;
2004-05-10 15:31:05 +00:00
public :
2014-04-25 14:00:35 +02:00
SwAuthMarkFloatDlg ( SfxBindings * pBindings ,
2004-05-10 15:31:05 +00:00
SfxChildWindow * pChild ,
2014-09-23 11:20:40 +02:00
vcl : : Window * pParent ,
2014-04-25 14:00:35 +02:00
SfxChildWinInfo * pInfo ,
bool bNew = true ) ;
2004-05-10 15:31:05 +00:00
void ReInitDlg ( SwWrtShell & rWrtShell ) ;
} ;
class SwAuthMarkModalDlg : public SvxStandardDialog
{
2012-10-19 18:20:58 +01:00
SwAuthorMarkPane m_aContent ;
2004-05-10 15:31:05 +00:00
public :
2014-09-23 11:20:40 +02:00
SwAuthMarkModalDlg ( vcl : : Window * pParent , SwWrtShell & rSh ) ;
2004-05-10 15:31:05 +00:00
2014-03-27 18:12:18 +01:00
virtual void Apply ( ) SAL_OVERRIDE ;
2004-05-10 15:31:05 +00:00
void ReInitDlg ( SwWrtShell & rWrtShell ) ;
} ;
2014-06-03 10:01:18 +02:00
# endif // INCLUDED_SW_SOURCE_UIBASE_INC_SWUIIDXMRK_HXX
2010-10-14 08:30:41 +02:00
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */