21#include <tools/datetime.hxx>
40#include <osl/diagnose.h>
41#include <osl/file.hxx>
43#include <LibreOfficeKit/LibreOfficeKitEnums.h>
50#include <com/sun/star/security/DocumentSignatureInformation.hpp>
51#include <com/sun/star/security/DocumentDigitalSignatures.hpp>
53#include <rtl/math.hxx>
54#include <com/sun/star/beans/PropertyAttribute.hpp>
55#include <com/sun/star/beans/XPropertyContainer.hpp>
56#include <com/sun/star/beans/XPropertySet.hpp>
57#include <com/sun/star/util/DateTime.hpp>
58#include <com/sun/star/util/Date.hpp>
59#include <com/sun/star/util/DateTimeWithTimezone.hpp>
60#include <com/sun/star/util/DateWithTimezone.hpp>
61#include <com/sun/star/util/Duration.hpp>
62#include <com/sun/star/document/XDocumentProperties.hpp>
63#include <com/sun/star/document/CmisProperty.hpp>
64#include <com/sun/star/lang/XMultiServiceFactory.hpp>
72#include <sfx2/sfxsids.hrc>
81#include <sfx2/strings.hrc>
105SfxPoolItem* SfxDocumentInfoItem::CreateDefault() {
return new SfxDocumentInfoItem; }
109OUString CreateSizeText( sal_Int64 nSize )
111 OUString aUnitStr =
" " +
SfxResId(STR_BYTES);
112 sal_Int64 nSize1 = nSize;
113 sal_Int64 nSize2 = nSize1;
114 sal_Int64 nMega = 1024 * 1024;
115 sal_Int64 nGiga = nMega * 1024;
116 double fSize = nSize;
119 if ( nSize1 >= 10000 && nSize1 < nMega )
126 else if ( nSize1 >= nMega && nSize1 < nGiga )
133 else if ( nSize1 >= nGiga )
142 OUString aSizeStr = rLocaleWrapper.
getNum( nSize1, 0 ) + aUnitStr;
143 if ( nSize1 < nSize2 )
145 aSizeStr = ::rtl::math::doubleToUString( fSize,
146 rtl_math_StringFormat_F, nDec,
150 + rLocaleWrapper.
getNum( nSize2, 0 )
158OUString ConvertDateTime_Impl( std::u16string_view rName,
163 static constexpr OUStringLiteral aDelim( u
", " );
168 if (!aAuthor.empty())
170 aStr += aDelim + aAuthor;
178SfxDocumentInfoItem::SfxDocumentInfoItem()
180 , m_isAutoloadEnabled(false)
182 , m_EditingDuration(0)
183 , m_bHasTemplate( true )
184 , m_bDeleteUserData( false )
185 , m_bUseUserData( true )
186 , m_bUseThumbnailSave( true )
190SfxDocumentInfoItem::SfxDocumentInfoItem(
const OUString& rFile,
191 const uno::Reference<document::XDocumentProperties>& i_xDocProps,
192 const uno::Sequence<document::CmisProperty>& i_cmisProps,
193 bool bIs,
bool _bIs )
195 , m_AutoloadDelay( i_xDocProps->getAutoloadSecs() )
196 , m_AutoloadURL( i_xDocProps->getAutoloadURL() )
197 , m_isAutoloadEnabled( (m_AutoloadDelay > 0) || !m_AutoloadURL.isEmpty() )
198 , m_DefaultTarget( i_xDocProps->getDefaultTarget() )
199 , m_TemplateName( i_xDocProps->getTemplateName() )
200 , m_Author( i_xDocProps->getAuthor() )
201 , m_CreationDate( i_xDocProps->getCreationDate() )
202 , m_ModifiedBy( i_xDocProps->getModifiedBy() )
203 , m_ModificationDate( i_xDocProps->getModificationDate() )
204 , m_PrintedBy( i_xDocProps->getPrintedBy() )
205 , m_PrintDate( i_xDocProps->getPrintDate() )
206 , m_EditingCycles( i_xDocProps->getEditingCycles() )
207 , m_EditingDuration( i_xDocProps->getEditingDuration() )
208 , m_Description( i_xDocProps->getDescription() )
210 i_xDocProps->getKeywords()) )
211 , m_Subject( i_xDocProps->getSubject() )
212 , m_Title( i_xDocProps->
getTitle() )
213 , m_bHasTemplate( true )
214 , m_bDeleteUserData( false )
215 , m_bUseUserData( bIs )
216 , m_bUseThumbnailSave( _bIs )
220 Reference< beans::XPropertyContainer > xContainer = i_xDocProps->getUserDefinedProperties();
221 if ( xContainer.is() )
223 Reference < beans::XPropertySet > xSet( xContainer, UNO_QUERY );
224 const Sequence< beans::Property > lProps = xSet->getPropertySetInfo()->getProperties();
225 for (
const beans::Property& rProp : lProps )
228 if (!(rProp.Attributes & css::beans::PropertyAttribute::REMOVABLE))
230 SAL_WARN(
"sfx.dialog",
"non-removable user-defined property?");
234 uno::Any aValue = xSet->getPropertyValue(rProp.Name);
235 AddCustomProperty( rProp.Name, aValue );
240 m_aCmisProperties = i_cmisProps;
242 catch ( Exception& ) {}
246SfxDocumentInfoItem::SfxDocumentInfoItem(
const SfxDocumentInfoItem& rItem )
248 , m_AutoloadDelay( rItem.getAutoloadDelay() )
249 , m_AutoloadURL( rItem.getAutoloadURL() )
250 , m_isAutoloadEnabled( rItem.isAutoloadEnabled() )
251 , m_DefaultTarget( rItem.getDefaultTarget() )
252 , m_TemplateName( rItem.getTemplateName() )
253 , m_Author( rItem.getAuthor() )
254 , m_CreationDate( rItem.getCreationDate() )
255 , m_ModifiedBy( rItem.getModifiedBy() )
256 , m_ModificationDate( rItem.getModificationDate() )
257 , m_PrintedBy( rItem.getPrintedBy() )
258 , m_PrintDate( rItem.getPrintDate() )
259 , m_EditingCycles( rItem.getEditingCycles() )
260 , m_EditingDuration( rItem.getEditingDuration() )
261 , m_Description( rItem.getDescription() )
262 , m_Keywords( rItem.getKeywords() )
263 , m_Subject( rItem.getSubject() )
265 , m_bHasTemplate( rItem.m_bHasTemplate )
266 , m_bDeleteUserData( rItem.m_bDeleteUserData )
267 , m_bUseUserData( rItem.m_bUseUserData )
268 , m_bUseThumbnailSave( rItem.m_bUseThumbnailSave )
270 for (
auto const & pOtherProp : rItem.m_aCustomProperties)
272 AddCustomProperty( pOtherProp->m_sName, pOtherProp->m_aValue );
275 m_aCmisProperties = rItem.m_aCmisProperties;
278SfxDocumentInfoItem::~SfxDocumentInfoItem()
280 ClearCustomProperties();
283SfxDocumentInfoItem* SfxDocumentInfoItem::Clone(
SfxItemPool * )
const
285 return new SfxDocumentInfoItem( *
this );
288bool SfxDocumentInfoItem::operator==(
const SfxPoolItem& rItem)
const
290 if (!SfxStringItem::operator==(rItem))
292 const SfxDocumentInfoItem& rInfoItem(
static_cast<const SfxDocumentInfoItem&
>(rItem));
295 m_AutoloadDelay == rInfoItem.m_AutoloadDelay &&
296 m_AutoloadURL == rInfoItem.m_AutoloadURL &&
297 m_isAutoloadEnabled == rInfoItem.m_isAutoloadEnabled &&
298 m_DefaultTarget == rInfoItem.m_DefaultTarget &&
299 m_Author == rInfoItem.m_Author &&
300 m_CreationDate == rInfoItem.m_CreationDate &&
301 m_ModifiedBy == rInfoItem.m_ModifiedBy &&
302 m_ModificationDate == rInfoItem.m_ModificationDate &&
303 m_PrintedBy == rInfoItem.m_PrintedBy &&
304 m_PrintDate == rInfoItem.m_PrintDate &&
305 m_EditingCycles == rInfoItem.m_EditingCycles &&
306 m_EditingDuration == rInfoItem.m_EditingDuration &&
307 m_Description == rInfoItem.m_Description &&
308 m_Keywords == rInfoItem.m_Keywords &&
309 m_Subject == rInfoItem.m_Subject &&
310 m_Title == rInfoItem.m_Title &&
312 m_aCmisProperties.getLength() == rInfoItem.m_aCmisProperties.getLength();
316void SfxDocumentInfoItem::resetUserData(
const OUString & i_rAuthor)
318 m_Author = i_rAuthor;
321 m_ModifiedBy = OUString();
322 m_PrintedBy = OUString();
323 m_ModificationDate = util::DateTime();
324 m_PrintDate = util::DateTime();
325 m_EditingDuration = 0;
330void SfxDocumentInfoItem::UpdateDocumentInfo(
331 const uno::Reference<document::XDocumentProperties>& i_xDocProps,
332 bool i_bDoNotUpdateUserDefined)
const
334 if (isAutoloadEnabled()) {
335 i_xDocProps->setAutoloadSecs(getAutoloadDelay());
336 i_xDocProps->setAutoloadURL(getAutoloadURL());
338 i_xDocProps->setAutoloadSecs(0);
339 i_xDocProps->setAutoloadURL(OUString());
341 i_xDocProps->setDefaultTarget(getDefaultTarget());
342 i_xDocProps->setAuthor(getAuthor());
343 i_xDocProps->setCreationDate(getCreationDate());
344 i_xDocProps->setModifiedBy(getModifiedBy());
345 i_xDocProps->setModificationDate(getModificationDate());
346 i_xDocProps->setPrintedBy(getPrintedBy());
347 i_xDocProps->setPrintDate(getPrintDate());
348 i_xDocProps->setEditingCycles(getEditingCycles());
349 i_xDocProps->setEditingDuration(getEditingDuration());
350 i_xDocProps->setDescription(getDescription());
351 i_xDocProps->setKeywords(
352 ::comphelper::string::convertCommaSeparated(getKeywords()));
353 i_xDocProps->setSubject(getSubject());
362 if (i_bDoNotUpdateUserDefined)
367 Reference< beans::XPropertyContainer > xContainer = i_xDocProps->getUserDefinedProperties();
368 Reference < beans::XPropertySet > xSet( xContainer, UNO_QUERY );
369 Reference< beans::XPropertySetInfo > xSetInfo = xSet->getPropertySetInfo();
370 const Sequence< beans::Property > lProps = xSetInfo->getProperties();
371 for (
const beans::Property& rProp : lProps )
373 if (rProp.Attributes & css::beans::PropertyAttribute::REMOVABLE)
375 xContainer->removeProperty( rProp.Name );
379 for (
auto const & pProp : m_aCustomProperties)
383 xContainer->addProperty( pProp->m_sName,
384 beans::PropertyAttribute::REMOVABLE, pProp->m_aValue );
386 catch ( Exception
const & )
388 TOOLS_WARN_EXCEPTION(
"sfx.dialog",
"SfxDocumentInfoItem::updateDocumentInfo(): exception while adding custom properties" );
392 catch ( Exception
const & )
394 TOOLS_WARN_EXCEPTION(
"sfx.dialog",
"SfxDocumentInfoItem::updateDocumentInfo(): exception while removing custom properties" );
399void SfxDocumentInfoItem::SetDeleteUserData(
bool bSet )
401 m_bDeleteUserData = bSet;
405void SfxDocumentInfoItem::SetUseUserData(
bool bSet )
407 m_bUseUserData = bSet;
410void SfxDocumentInfoItem::SetUseThumbnailSave(
bool bSet )
412 m_bUseThumbnailSave = bSet;
415std::vector< std::unique_ptr<CustomProperty> > SfxDocumentInfoItem::GetCustomProperties()
const
417 std::vector< std::unique_ptr<CustomProperty> > aRet;
418 for (
auto const & pOtherProp : m_aCustomProperties)
420 std::unique_ptr<CustomProperty> pProp(
new CustomProperty( pOtherProp->m_sName,
421 pOtherProp->m_aValue ));
422 aRet.push_back( std::move(pProp) );
428void SfxDocumentInfoItem::ClearCustomProperties()
430 m_aCustomProperties.clear();
433void SfxDocumentInfoItem::AddCustomProperty(
const OUString& sName,
const Any& rValue )
435 std::unique_ptr<CustomProperty> pProp(
new CustomProperty( sName, rValue ));
436 m_aCustomProperties.push_back( std::move(pProp) );
440void SfxDocumentInfoItem::SetCmisProperties(
const Sequence< document::CmisProperty >& cmisProps)
442 m_aCmisProperties = cmisProps;
445bool SfxDocumentInfoItem::QueryValue( Any& rVal,
sal_uInt8 nMemberId )
const
451 bool bIsString =
false;
452 nMemberId &= ~CONVERT_TWIPS;
456 bValue = IsUseUserData();
459 bValue = IsUseThumbnailSave();
462 bValue = m_bDeleteUserData;
465 bValue = isAutoloadEnabled();
469 nValue = getAutoloadDelay();
473 aValue = getAutoloadURL();
477 aValue = getDefaultTarget();
481 aValue = getDescription();
485 aValue = getKeywords();
489 aValue = getSubject();
496 OSL_FAIL(
"Wrong MemberId!");
509bool SfxDocumentInfoItem::PutValue(
const Any& rVal,
sal_uInt8 nMemberId )
515 nMemberId &= ~CONVERT_TWIPS;
519 bRet = (rVal >>= bValue);
521 SetUseUserData( bValue );
524 bRet = (rVal >>=bValue);
526 SetUseThumbnailSave( bValue );
530 bRet = (rVal >>= bValue);
532 SetDeleteUserData( bValue );
535 bRet = (rVal >>= bValue);
537 m_isAutoloadEnabled = bValue;
545 bRet = (rVal >>= aValue);
547 m_AutoloadURL = aValue;
550 bRet = (rVal >>= aValue);
552 m_DefaultTarget = aValue;
555 bRet = (rVal >>= aValue);
557 setDescription(aValue);
560 bRet = (rVal >>= aValue);
565 bRet = (rVal >>= aValue);
570 bRet = (rVal >>= aValue);
575 OSL_FAIL(
"Wrong MemberId!");
583 :
SfxTabPage(pPage, pController,
"sfx/ui/descriptioninfopage.ui",
"DescriptionInfoPage", &rItemSet)
584 , m_pInfoItem(nullptr)
585 , m_xTitleEd(m_xBuilder->weld_entry(
"title"))
586 , m_xThemaEd(m_xBuilder->weld_entry(
"subject"))
587 , m_xKeywordsEd(m_xBuilder->weld_entry(
"keywords"))
588 , m_xCommentEd(m_xBuilder->weld_text_view(
"comments"))
600 return std::make_unique<SfxDocumentDescPage>(pPage, pController, *rItemSet);
606 const bool bTitleMod =
m_xTitleEd->get_value_changed_from_saved();
607 const bool bThemeMod =
m_xThemaEd->get_value_changed_from_saved();
608 const bool bKeywordsMod =
m_xKeywordsEd->get_value_changed_from_saved();
609 const bool bCommentMod =
m_xCommentEd->get_value_changed_from_saved();
610 if ( !( bTitleMod || bThemeMod || bKeywordsMod || bCommentMod ) )
616 const SfxDocumentInfoItem* pItem =
nullptr;
617 SfxDocumentInfoItem* pInfo =
nullptr;
620 if ( pExSet && !(pItem = pExSet->
GetItemIfSet( SID_DOCINFO )) )
623 pInfo =
new SfxDocumentInfoItem( *pItem );
627 SAL_WARN(
"sfx.dialog",
"SfxDocumentDescPage::FillItemSet(): no item found" );
670 const SfxBoolItem* pROItem = SfxItemSet::GetItem<SfxBoolItem>(
rSet, SID_DOC_READONLY,
false);
681 :
SfxTabPage(pPage, pController,
"sfx/ui/documentinfopage.ui",
"DocumentInfoPage", &rItemSet)
682 , bEnableUseUserData( false )
683 , bHandleDelete( false )
684 , m_xBmp(m_xBuilder->weld_image(
"icon"))
685 , m_xNameED(m_xBuilder->weld_label(
"nameed"))
686 , m_xChangePassBtn(m_xBuilder->weld_button(
"changepass"))
687 , m_xShowTypeFT(m_xBuilder->weld_label(
"showtype"))
688 , m_xFileValEd(m_xBuilder->weld_link_button(
"showlocation"))
689 , m_xShowSizeFT(m_xBuilder->weld_label(
"showsize"))
690 , m_xCreateValFt(m_xBuilder->weld_label(
"showcreate"))
691 , m_xChangeValFt(m_xBuilder->weld_label(
"showmodify"))
692 , m_xSignedValFt(m_xBuilder->weld_label(
"showsigned"))
693 , m_xSignatureBtn(m_xBuilder->weld_button(
"signature"))
694 , m_xPrintValFt(m_xBuilder->weld_label(
"showprint"))
695 , m_xTimeLogValFt(m_xBuilder->weld_label(
"showedittime"))
696 , m_xDocNoValFt(m_xBuilder->weld_label(
"showrevision"))
697 , m_xUseUserDataCB(m_xBuilder->weld_check_button(
"userdatacb"))
698 , m_xDeleteBtn(m_xBuilder->weld_button(
"reset"))
699 , m_xUseThumbnailSaveCB(m_xBuilder->weld_check_button(
"thumbnailsavecb"))
700 , m_xTemplFt(m_xBuilder->weld_label(
"templateft"))
701 , m_xTemplValFt(m_xBuilder->weld_label(
"showtemplate"))
702 , m_xImagePreferredDpiCheckButton(m_xBuilder->weld_check_button(
"image-preferred-dpi-checkbutton"))
703 , m_xImagePreferredDpiComboBox(m_xBuilder->weld_combo_box(
"image-preferred-dpi-combobox"))
741 if (bEnableUseUserData && m_xUseUserDataCB->get_active())
746 m_xCreateValFt->set_label( ConvertDateTime_Impl(
aName, uDT, rLocaleWrapper ) );
747 m_xChangeValFt->set_label(
"" );
748 m_xPrintValFt->set_label(
"" );
750 m_xDocNoValFt->set_label(OUString(
'1'));
751 bHandleDelete =
true;
761 ImplUpdateSignatures();
767 bool bEnabled = m_xImagePreferredDpiCheckButton->get_state() ==
TRISTATE_TRUE;
768 m_xImagePreferredDpiComboBox->set_sensitive(bEnabled);
789 m_xPasswordDialog->AllowEmpty();
790 m_xPasswordDialog->StartExecuteAsync([
this, pFilter, &rMedSet, pShell](sal_Int32 nResult)
795 m_xPasswordDialog->GetPasswordToOpen(),
true);
797 payloadJson.
put(
"password", m_xPasswordDialog->GetPasswordToOpen());
798 payloadJson.
put(
"isToModify",
false);
803 m_xPasswordDialog->disposeOnce();
823 Reference< security::XDocumentDigitalSignatures > xD;
829 catch (
const css::uno::DeploymentException& )
833 Sequence< security::DocumentSignatureInformation >
aInfos;
837 uno::Reference< io::XInputStream >() );
838 if (
aInfos.getLength() > 1 )
840 else if (
aInfos.getLength() == 1 )
842 const security::DocumentSignatureInformation& rInfo =
aInfos[ 0 ];
857 uno::Sequence< beans::NamedValue > aEncryptionData;
858 if (pEncryptionDataItem)
859 pEncryptionDataItem->
GetValue() >>= aEncryptionData;
863 if (!aEncryptionData.hasElements())
874 return std::make_unique<SfxDocumentPage>(pPage, pController, *rItemSet);
892 const SfxDocumentInfoItem* pInfoItem;
894 if ( pExpSet && (pInfoItem = pExpSet->
GetItemIfSet( SID_DOCINFO ) ) )
897 const_cast<SfxDocumentInfoItem*
>(pInfoItem)->SetUseUserData( bUseData );
906 const SfxDocumentInfoItem* pInfoItem;
907 if ( pExpSet && (pInfoItem = pExpSet->
GetItemIfSet( SID_DOCINFO )) )
910 SfxDocumentInfoItem newItem( *pInfoItem );
911 newItem.resetUserData( bUseAuthor
917 newItem.SetDeleteUserData(
true );
926 const SfxDocumentInfoItem* pInfoItem;
928 if ( pExpSet && (pInfoItem = pExpSet->
GetItemIfSet( SID_DOCINFO )) )
931 const_cast<SfxDocumentInfoItem*
>(pInfoItem)->SetUseThumbnailSave( bUseThumbnail );
940 uno::Reference<lang::XMultiServiceFactory> xFac(pDocSh->
GetModel(), uno::UNO_QUERY);
943 uno::Reference<beans::XPropertySet> xProps(xFac->createInstance(
"com.sun.star.document.Settings"), uno::UNO_QUERY);
946 sal_Int32 nImagePreferredDPI = 0;
950 nImagePreferredDPI = aImagePreferredDPIString.toInt32();
952 xProps->setPropertyValue(
"ImagePreferredDPI",
uno::Any(nImagePreferredDPI));
963 const SfxDocumentInfoItem& rInfoItem =
rSet->
Get(SID_DOCINFO);
966 if (rInfoItem.HasTemplate())
968 const OUString& rName = rInfoItem.getTemplateName();
981 OUString aFile( rInfoItem.GetValue() );
982 OUString aFactory( aFile );
983 if ( aFile.getLength() > 2 && aFile[0] ==
'[' )
985 sal_Int32
nPos = aFile.indexOf(
']' );
986 aFactory = aFile.copy( 1,
nPos-1 );
987 aFile = aFile.copy(
nPos+1 );
993 if (
aName.isEmpty() ||
aURL.GetProtocol() == INetProtocol::PrivSoffice )
998 aURL.SetSmartProtocol( INetProtocol::File );
999 aURL.SetSmartURL( aFactory);
1002 m_xBmp->set_from_icon_name(aImage);
1006 if (
aURL.GetProtocol() == INetProtocol::File ||
1007 aURL.isAnyKnownWebDAVScheme() )
1012 if ( aDescription.isEmpty() )
1013 aDescription =
SfxResId( STR_SFX_NEWOFFICEDOC );
1025 OUString sExtension(
INetURLObject(rMainURL).getExtension());
1026 if (!sExtension.isEmpty())
1028 sExtension = sExtension.toAsciiLowerCase();
1029 if (sExtension ==
"txt" || sExtension ==
"csv")
1035 aURL.SetSmartURL( aFile);
1036 if (
aURL.GetProtocol() == INetProtocol::File )
1046 osl::FileBase::getFileURLFromSystemPath(aText, aURLStr);
1049 else if (
aURL.GetProtocol() != INetProtocol::PrivSoffice)
1058 bool bUseUserData = rInfoItem.IsUseUserData();
1060 m_xCreateValFt->set_label( ConvertDateTime_Impl( rInfoItem.getAuthor(),
1061 rInfoItem.getCreationDate(), rLocaleWrapper ) );
1062 util::DateTime aTime( rInfoItem.getModificationDate() );
1063 if ( aTime.Month > 0 )
1065 rInfoItem.getModifiedBy(), aTime, rLocaleWrapper ) );
1066 aTime = rInfoItem.getPrintDate();
1067 if ( aTime.Month > 0 )
1068 m_xPrintValFt->set_label( ConvertDateTime_Impl( rInfoItem.getPrintedBy(),
1069 aTime, rLocaleWrapper ) );
1070 const tools::Long nTime = rInfoItem.getEditingDuration();
1075 (nTime%86400)/3600, (nTime%3600)/60, nTime%60, 0);
1078 rInfoItem.getEditingCycles() ) );
1081 bool bUseThumbnailSave = rInfoItem.IsUseThumbnailSave();
1084 if ( rInfoItem.isCmisDocument( ) )
1086 const uno::Sequence< document::CmisProperty > aCmisProps = rInfoItem.GetCmisProperties();
1087 for (
const auto& rCmisProp : aCmisProps )
1089 if ( rCmisProp.Id ==
"cmis:contentStreamLength" &&
1092 Sequence< sal_Int64 > seqValue;
1093 rCmisProp.Value >>= seqValue;
1097 if ( seqValue.hasElements() )
1101 m_xShowSizeFT->set_label( CreateSizeText( sValue.toInt64( ) ) );
1106 OUString emptyDate = ConvertDateTime_Impl(
u"", uDT, rLocaleWrapper );
1107 if ( rCmisProp.Id ==
"cmis:creationDate" &&
1111 Sequence< util::DateTime > seqValue;
1112 rCmisProp.Value >>= seqValue;
1113 if ( seqValue.hasElements() )
1115 m_xCreateValFt->set_label( ConvertDateTime_Impl(
u"", seqValue[0], rLocaleWrapper ) );
1118 if ( rCmisProp.Id ==
"cmis:lastModificationDate" &&
1122 Sequence< util::DateTime > seqValue;
1123 rCmisProp.Value >>= seqValue;
1124 if ( seqValue.hasElements() )
1126 m_xChangeValFt->set_label( ConvertDateTime_Impl(
u"", seqValue[0], rLocaleWrapper ) );
1141 sal_Int32 nImagePreferredDPI = 0;
1146 uno::Reference< lang::XMultiServiceFactory > xFac( pDocSh->
GetModel(), uno::UNO_QUERY_THROW );
1147 uno::Reference< beans::XPropertySet > xProps( xFac->createInstance(
"com.sun.star.document.Settings"), uno::UNO_QUERY_THROW );
1149 xProps->getPropertyValue(
"ImagePreferredDPI") >>= nImagePreferredDPI;
1151 catch( uno::Exception& )
1155 if (nImagePreferredDPI > 0)
1172 "DocumentPropertiesDialog", &rItemSet)
1174 const SfxDocumentInfoItem& rInfoItem = rItemSet.
Get( SID_DOCINFO );
1178 DBG_ASSERT( pURLItem,
"No BaseURL provided for InternetTabPage!" );
1182 OUString aTitle(
m_xDialog->get_title());
1187 const OUString& aFile( rInfoItem.GetValue() );
1190 aURL.SetSmartProtocol( INetProtocol::File );
1191 aURL.SetSmartURL( aFile);
1192 if ( INetProtocol::PrivSoffice !=
aURL.GetProtocol() )
1194 OUString aLastName(
aURL.GetLastName() );
1195 if ( !aLastName.isEmpty() )
1196 aTitle = aTitle.replaceFirst(
"%1", aLastName);
1198 aTitle = aTitle.replaceFirst(
"%1", aFile);
1201 aTitle = aTitle.replaceFirst(
"%1",
SfxResId( STR_NONAME ));
1205 aTitle = aTitle.replaceFirst(
"%1", pItem->
GetValue());
1218 if (rInfoItem.isCmisDocument())
1231 if (rId ==
"general")
1243 std::unique_ptr<weld::RadioButton> xYesButton,
1244 std::unique_ptr<weld::RadioButton> xNoButton)
1245 : m_xTopLevel(
std::move(xTopLevel))
1246 , m_xYesButton(
std::move(xYesButton))
1247 , m_xNoButton(
std::move(xNoButton))
1258 : GenericDialogController(pParent,
"sfx/ui/editdurationdialog.ui",
"EditDurationDialog")
1259 , m_xNegativeCB(m_xBuilder->weld_check_button(
"negative"))
1260 , m_xYearNF(m_xBuilder->weld_spin_button(
"years"))
1261 , m_xMonthNF(m_xBuilder->weld_spin_button(
"months"))
1262 , m_xDayNF(m_xBuilder->weld_spin_button(
"days"))
1263 , m_xHourNF(m_xBuilder->weld_spin_button(
"hours"))
1264 , m_xMinuteNF(m_xBuilder->weld_spin_button(
"minutes"))
1265 , m_xSecondNF(m_xBuilder->weld_spin_button(
"seconds"))
1266 , m_xMSecondNF(m_xBuilder->weld_spin_button(
"milliseconds"))
1271 m_xDayNF->set_value(rDuration.Days);
1280 util::Duration aRet;
1293 std::unique_ptr<weld::Button> xEditButton)
1294 : m_xEntry(
std::move(xEntry))
1295 , m_xEditButton(
std::move(xEditButton))
1298 SetDuration( util::Duration(
false, 0, 0, 0, 0, 0, 0, 0) );
1310 OUString sText = (rDuration.Negative ? OUString(
'-') : OUString(
'+')) +
1312 sText = sText.replaceFirst(
"%1", OUString::number( rDuration.Years ) );
1313 sText = sText.replaceFirst(
"%2", OUString::number( rDuration.Months ) );
1314 sText = sText.replaceFirst(
"%3", OUString::number( rDuration.Days ) );
1315 sText = sText.replaceFirst(
"%4", OUString::number( rDuration.Hours ) );
1316 sText = sText.replaceFirst(
"%5", OUString::number( rDuration.Minutes) );
1317 sText = sText.replaceFirst(
"%6", OUString::number( rDuration.Seconds) );
1323 m_xDurationDialog = std::make_shared<DurationDialog_Impl>(&rButton,
GetDuration());
1328 SetDuration(m_xDurationDialog->GetDuration());
1353 OUString
sId(OUString::number(SFX_LB_PROPERTY_STRINGARRAY[i].second));
1354 rTypeBox.
append(sId,
SfxResId(SFX_LB_PROPERTY_STRINGARRAY[i].first));
1364 : m_pParent(pParent)
1365 , m_xBuilder(
Application::CreateBuilder(pContainer,
"sfx/ui/linefragment.ui"))
1366 , m_xLine(m_xBuilder->weld_container(
"lineentry"))
1367 , m_xNameBox(m_xBuilder->weld_combo_box(
"namebox"))
1368 , m_xTypeBox(m_xBuilder->weld_combo_box(
"typebox"))
1369 , m_xValueEdit(m_xBuilder->weld_entry(
"valueedit"))
1370 , m_xDateTimeBox(m_xBuilder->weld_widget(
"datetimebox"))
1373 , m_xDurationBox(m_xBuilder->weld_widget(
"durationbox"))
1375 m_xBuilder->weld_button(
"durationbutton")))
1377 m_xBuilder->weld_radio_button(
"yes"),
1378 m_xBuilder->weld_radio_button(
"no")))
1379 , m_xRemoveButton(m_xBuilder->weld_button(
"remove"))
1380 , m_bTypeLostFocus( false )
1409 , m_pCurrentLine(nullptr)
1411 Application::GetSettings().GetLanguageTag().getLanguageType())
1412 , m_aEditLoseFocusIdle(
"sfx2 CustomPropertiesWindow loseFocusIdle")
1413 , m_aBoxLoseFocusIdle(
"sfx2 CustomPropertiesWindow m_aBoxLoseFocusIdle")
1415 , m_rHeaderAccName(rHeaderAccName)
1416 , m_rHeaderAccType(rHeaderAccType)
1417 , m_rHeaderAccValue(rHeaderAccValue)
1455 [&] (
const std::unique_ptr<CustomPropertyLine>&
p) { return p.get() == pLine; });
1470 m_pParent->Remove(
this);
1481 if (!m_bTypeLostFocus)
1482 m_pParent->EditLoseFocus(
this);
1484 m_bTypeLostFocus =
false;
1495 m_pParent->BoxLoseFocus(
this);
1500 ValidateLine( m_pCurrentLine,
false );
1505 ValidateLine( m_pCurrentLine,
true );
1510 bool bIsValid =
true;
1514 if ( sValue.isEmpty() )
1518 if ( Custom_Type_Number ==
nType )
1522 else if ( Custom_Type_Date ==
nType )
1528 sal_uInt32 nTemp =
nIndex;
1529 double fDummy = 0.0;
1532 if ( bIsValid && nTemp !=
nIndex )
1544 if ( bIsFromTypeBox )
1547 VclMessageType::Question, VclButtonsType::OkCancel,
SfxResId(STR_SFX_QUERY_WRONG_TYPE)));
1548 if (xMessageBox->run() ==
RET_OK)
1549 pLine->
m_xTypeBox->set_active_id(OUString::number(Custom_Type_Text));
1586 pNewLine->
m_xNameBox->get_buildable_name() + OUString::number(nSize));
1588 pNewLine->
m_xTypeBox->get_buildable_name() + OUString::number(nSize));
1590 pNewLine->
m_xValueEdit->get_buildable_name() + OUString::number(nSize));
1592 pNewLine->
m_xRemoveButton->get_buildable_name() + OUString::number(nSize));
1638 [](
const auto& el) { return comphelper::makePropertyValue(el->m_sName, el->m_aValue); });
1640 return aPropertiesSeq;
1644 : m_xTimeField(
std::move(xTimeField))
1645 , m_xFormatter(new
weld::TimeFormatter(*m_xTimeField))
1648 m_xFormatter->SetExtFormat(ExtTimeFieldFormat::LongDuration);
1667 : m_xDateField(pDateField)
1700 OUString sPropertyName = pLine->
m_xNameBox->get_active_text();
1701 if (!sPropertyName.isEmpty())
1705 if (Custom_Type_Number ==
nType)
1714 else if (Custom_Type_Boolean ==
nType)
1719 else if (Custom_Type_Datetime ==
nType)
1723 util::DateTime
const aDateTime(aTmpTime.
GetNanoSec(),
1737 else if (Custom_Type_Date ==
nType)
1752 else if (Custom_Type_Duration ==
nType)
1773 double nTmpValue = 0;
1774 bool bTmpValue =
false;
1776 util::DateTime aTmpDateTime;
1777 util::Date aTmpDate;
1778 util::DateTimeWithTimezone aTmpDateTimeTZ;
1779 util::DateWithTimezone aTmpDateTZ;
1780 util::Duration aTmpDuration;
1783 CustomProperties
nType = Custom_Type_Unknown;
1800 if (!rAny.hasValue())
1804 else if (rAny >>= nTmpValue)
1809 nType = Custom_Type_Number;
1811 else if (rAny >>= bTmpValue)
1814 nType = Custom_Type_Boolean;
1816 else if (rAny >>= sTmpValue)
1819 nType = Custom_Type_Text;
1821 else if (rAny >>= aTmpDate)
1824 nType = Custom_Type_Date;
1826 else if (rAny >>= aTmpDateTime)
1831 nType = Custom_Type_Datetime;
1833 else if (rAny >>= aTmpDateTZ)
1836 aTmpDateTZ.DateInTZ.Month, aTmpDateTZ.DateInTZ.Year));
1838 nType = Custom_Type_Date;
1841 else if (rAny >>= aTmpDateTimeTZ)
1843 util::DateTime
const& rDT(aTmpDateTimeTZ.DateTimeInTZ);
1848 nType = Custom_Type_Datetime;
1850 else if (rAny >>= aTmpDuration)
1852 nType = Custom_Type_Duration;
1856 if (Custom_Type_Boolean ==
nType)
1899 m_xBox->set_stack_background();
1903 Size aLineSize(xNewLine->m_xLine->get_preferred_size());
1906 auto nHeight = aLineSize.
Height() * 8;
1912 m_xName->set_size_request(xNewLine->m_xNameBox->get_preferred_size().Width(), -1);
1913 m_xType->set_size_request(xNewLine->m_xTypeBox->get_preferred_size().Width(), -1);
1914 m_xValue->set_size_request(xNewLine->m_xValueEdit->get_preferred_size().Width(), -1);
1916 m_xBody->move(xNewLine->m_xLine.get(),
nullptr);
1928 ResizeHdl(
Size(-1, nHeight));
1933 int nHeight = rSize.Height() - 6;
1934 if (nHeight == m_xPropertiesWin->GetHeight())
1936 m_xPropertiesWin->SetHeight(nHeight);
1937 sal_Int32 nScrollOffset = m_xPropertiesWin->GetLineHeight();
1938 sal_Int32 nVisibleEntries = nHeight / nScrollOffset;
1939 m_xPropertiesWin->SetVisibleLineCount( nVisibleEntries );
1940 m_xVertScroll->vadjustment_set_page_increment( nVisibleEntries - 1 );
1941 m_xVertScroll->vadjustment_set_page_size( nVisibleEntries );
1942 m_xPropertiesWin->ReloadLinesContent();
1951 sal_Int32 nOffset = m_xPropertiesWin->GetLineHeight();
1952 int nThumbPos = rScrollBar.vadjustment_get_value();
1953 nOffset *= ( m_nThumbPos - nThumbPos );
1954 m_nThumbPos = nThumbPos;
1955 m_xPropertiesWin->DoScroll( nOffset );
1960 auto nLineCount = m_xPropertiesWin->GetTotalLineCount();
1961 m_xVertScroll->vadjustment_set_upper(nLineCount + 1);
1962 if (m_xPropertiesWin->GetTotalLineCount() > m_xPropertiesWin->GetExistingLineCount())
1964 m_xVertScroll->vadjustment_set_value(nLineCount - 1);
1965 ScrollHdl(*m_xVertScroll);
1990 :
SfxTabPage(pPage, pController,
"sfx/ui/custominfopage.ui",
"CustomInfoPage", &rItemSet)
1992 , m_xAdd(m_xBuilder->weld_button(
"add"))
2008 SfxDocumentInfoItem pInfo;
2009 const Sequence< beans::PropertyValue > aPropertySeq = m_xPropertiesCtrl->GetCustomProperties();
2010 for (
const auto& rProperty : aPropertySeq )
2012 if ( !rProperty.Name.isEmpty() )
2014 pInfo.AddCustomProperty( rProperty.Name, rProperty.Value );
2019 m_xPropertiesCtrl->AddLine(aAny);
2024 const SfxDocumentInfoItem* pItem =
nullptr;
2025 SfxDocumentInfoItem* pInfo =
nullptr;
2026 bool bMustDelete =
false;
2030 pItem = pItemSet->GetItemIfSet(SID_DOCINFO);
2032 pInfo =
const_cast<SfxDocumentInfoItem*
>(&
rSet->
Get( SID_DOCINFO ));
2036 pInfo =
new SfxDocumentInfoItem( *pItem );
2043 if ( pInfo->isCmisDocument( ) )
2050 pInfo->ClearCustomProperties();
2051 const Sequence< beans::PropertyValue > aPropertySeq =
m_xPropertiesCtrl->GetCustomProperties();
2052 for (
const auto& rProperty : aPropertySeq )
2054 if ( !rProperty.Name.isEmpty() )
2055 pInfo->AddCustomProperty( rProperty.Name, rProperty.Value );
2071 const SfxDocumentInfoItem& rInfoItem = rItemSet->
Get(SID_DOCINFO);
2072 std::vector< std::unique_ptr<CustomProperty> > aCustomProps = rInfoItem.GetCustomProperties();
2077 std::sort(aCustomProps.begin(), aCustomProps.end(),
2078 [&sort](
const std::unique_ptr<CustomProperty>& rLHS,
2079 const std::unique_ptr<CustomProperty>& rRHS) {
2080 return sort.compare(rLHS->m_sName, rRHS->m_sName) < 0;
2095 return std::make_unique<SfxCustomPropertiesPage>(pPage, pController, *rItemSet);
2099 : m_xBuilder(
Application::CreateBuilder(pParent,
"sfx/ui/cmisline.ui"))
2100 ,
m_xFrame(m_xBuilder->weld_frame(
"CmisFrame"))
2101 , m_xValueEdit(m_xBuilder->weld_entry(
"value"))
2108 : m_xBuilder(
Application::CreateBuilder(pParent,
"sfx/ui/cmisline.ui"))
2109 ,
m_xFrame(m_xBuilder->weld_frame(
"CmisFrame"))
2110 , m_xDateField(new
SvtCalendarBox(m_xBuilder->weld_menu_button(
"date")))
2111 , m_xTimeField(m_xBuilder->weld_formatted_spin_button(
"time"))
2112 , m_xFormatter(new
weld::TimeFormatter(*m_xTimeField))
2114 m_xFormatter->SetExtFormat(ExtTimeFieldFormat::LongDuration);
2124 : m_xBuilder(
Application::CreateBuilder(pParent,
"sfx/ui/cmisline.ui"))
2125 ,
m_xFrame(m_xBuilder->weld_frame(
"CmisFrame"))
2126 , m_xYesButton(m_xBuilder->weld_radio_button(
"yes"))
2127 , m_xNoButton(m_xBuilder->weld_radio_button(
"no"))
2139 : m_xBuilder(
Application::CreateBuilder(pParent,
"sfx/ui/cmisline.ui"))
2141 , m_bUpdatable(false)
2142 , m_bRequired(false)
2143 , m_bMultiValued(false)
2144 , m_bOpenChoice(false)
2145 ,
m_xFrame(m_xBuilder->weld_frame(
"CmisFrame"))
2146 , m_xName(m_xBuilder->weld_label(
"name"))
2147 , m_xType(m_xBuilder->weld_label(
"type"))
2159 : m_xBox(
std::move(xParent))
2161 Application::GetSettings().GetLanguageTag().getLanguageType())
2175 const OUString& sType,
const bool bUpdatable,
2176 const bool bRequired,
const bool bMultiValued,
2177 const bool bOpenChoice, Any& , Any
const & rAny )
2181 pNewLine->m_sId =
sId;
2182 pNewLine->m_sType =
sType;
2183 pNewLine->m_bUpdatable = bUpdatable;
2184 pNewLine->m_bRequired = bRequired;
2185 pNewLine->m_bMultiValued = bMultiValued;
2186 pNewLine->m_bOpenChoice = bOpenChoice;
2190 Sequence< sal_Int64 > seqValue;
2193 for (
const auto& rValue : std::as_const(seqValue) )
2197 std::unique_ptr<CmisValue> pValue(
new CmisValue(
m_xBox.get(), sValue));
2198 pValue->m_xValueEdit->set_editable(bUpdatable);
2199 pNewLine->m_aValues.push_back( std::move(pValue) );
2204 Sequence< double > seqValue;
2207 for (
const auto& rValue : std::as_const(seqValue) )
2211 std::unique_ptr<CmisValue> pValue(
new CmisValue(
m_xBox.get(), sValue));
2212 pValue->m_xValueEdit->set_editable(bUpdatable);
2213 pNewLine->m_aValues.push_back( std::move(pValue) );
2219 Sequence<sal_Bool> seqValue;
2221 for (
const auto& rValue : std::as_const(seqValue) )
2223 std::unique_ptr<CmisYesNo> pYesNo(
new CmisYesNo(
m_xBox.get(), rValue));
2224 pYesNo->m_xYesButton->set_sensitive( bUpdatable );
2225 pYesNo->m_xNoButton->set_sensitive( bUpdatable );
2226 pNewLine->m_aYesNos.push_back( std::move(pYesNo) );
2231 Sequence< OUString > seqValue;
2233 for (
const auto& rValue : std::as_const(seqValue) )
2235 std::unique_ptr<CmisValue> pValue(
new CmisValue(
m_xBox.get(), rValue));
2236 pValue->m_xValueEdit->set_editable(bUpdatable);
2237 pNewLine->m_aValues.push_back( std::move(pValue) );
2242 Sequence< util::DateTime > seqValue;
2244 for (
const auto& rValue : std::as_const(seqValue) )
2247 pDateTime->m_xDateField->set_sensitive(bUpdatable);
2248 pDateTime->m_xTimeField->set_sensitive(bUpdatable);
2249 pNewLine->m_aDateTimes.push_back( std::move(pDateTime) );
2252 pNewLine->m_xName->set_label(
sName );
2253 pNewLine->m_xName->show();
2254 pNewLine->m_xType->set_label(
sType );
2255 pNewLine->m_xType->show();
2263 auto aPropertiesSeqRange = asNonConstRange(aPropertiesSeq);
2269 aPropertiesSeqRange[
i].Id = pLine->
m_sId;
2270 aPropertiesSeqRange[
i].Type = pLine->
m_sType;
2276 OUString sPropertyName = pLine->
m_xName->get_label();
2277 if ( !sPropertyName.isEmpty() )
2279 aPropertiesSeqRange[
i].Name = sPropertyName;
2285 Sequence< double > seqValue( pLine->
m_aValues.size( ) );
2286 auto seqValueRange = asNonConstRange(seqValue);
2288 for (
const auto& rxValue : pLine->
m_aValues )
2290 double dValue = 0.0;
2291 OUString sValue( rxValue->m_xValueEdit->get_text() );
2293 IsNumberFormat( sValue,
nIndex, dValue );
2295 seqValueRange[k] = dValue;
2298 aPropertiesSeqRange[
i].Value <<= seqValue;
2304 Sequence< sal_Int64 > seqValue( pLine->
m_aValues.size( ) );
2305 auto seqValueRange = asNonConstRange(seqValue);
2307 for (
const auto& rxValue : pLine->
m_aValues )
2310 OUString sValue( rxValue->m_xValueEdit->get_text() );
2312 IsNumberFormat( sValue,
nIndex, dValue );
2314 seqValueRange[k] =
static_cast<sal_Int64
>(dValue);
2317 aPropertiesSeqRange[
i].Value <<= seqValue;
2321 Sequence<sal_Bool> seqValue( pLine->
m_aYesNos.size( ) );
2322 sal_Bool* pseqValue = seqValue.getArray();
2324 for (
const auto& rxYesNo : pLine->
m_aYesNos )
2326 bool bValue = rxYesNo->m_xYesButton->get_active();
2327 pseqValue[k] = bValue;
2330 aPropertiesSeqRange[
i].Value <<= seqValue;
2335 Sequence< util::DateTime > seqValue( pLine->
m_aDateTimes.size( ) );
2336 auto seqValueRange = asNonConstRange(seqValue);
2340 Date aTmpDate = rxDateTime->m_xDateField->get_date();
2346 seqValueRange[k] = aDateTime;
2349 aPropertiesSeqRange[
i].Value <<= seqValue;
2353 Sequence< OUString > seqValue( pLine->
m_aValues.size( ) );
2354 auto seqValueRange = asNonConstRange(seqValue);
2356 for (
const auto& rxValue : pLine->
m_aValues )
2358 OUString sValue( rxValue->m_xValueEdit->get_text() );
2359 seqValueRange[k] = sValue;
2362 aPropertiesSeqRange[
i].Value <<= seqValue;
2368 return aPropertiesSeq;
2372 : m_aPropertiesWin(rBuilder.weld_container(
"CmisWindow"))
2373 , m_xScrolledWindow(rBuilder.weld_scrolled_window(
"CmisScroll"))
2386 const OUString& sType,
const bool bUpdatable,
2387 const bool bRequired,
const bool bMultiValued,
2388 const bool bOpenChoice, Any& aChoices, Any
const & rAny
2392 bOpenChoice, aChoices, rAny );
2397 :
SfxTabPage(pPage, pController,
"sfx/ui/cmisinfopage.ui",
"CmisInfoPage", &rItemSet)
2409 const SfxDocumentInfoItem* pItem =
nullptr;
2410 SfxDocumentInfoItem* pInfo =
nullptr;
2411 bool bMustDelete =
false;
2415 pItem = pItemSet->GetItemIfSet(SID_DOCINFO);
2417 pInfo =
const_cast<SfxDocumentInfoItem*
>(&
rSet->
Get( SID_DOCINFO ));
2421 pInfo =
new SfxDocumentInfoItem( *pItem );
2425 sal_Int32 modifiedNum = 0;
2428 Sequence< document::CmisProperty > aOldProps = pInfo->GetCmisProperties( );
2429 Sequence< document::CmisProperty > aNewProps =
m_xPropertiesCtrl->GetCmisProperties();
2431 std::vector< document::CmisProperty > changedProps;
2432 for ( sal_Int32
i = 0;
i< aNewProps.getLength( ); ++
i )
2434 if ( aOldProps[
i].Updatable && !aNewProps[
i].
Id.isEmpty( ) )
2438 Sequence< util::DateTime > oldValue;
2439 aOldProps[
i].Value >>= oldValue;
2442 for (
auto& rDateTime : asNonConstRange(oldValue) )
2444 rDateTime.NanoSeconds = 0;
2445 rDateTime.Seconds = 0;
2447 Sequence< util::DateTime > newValue;
2448 aNewProps[
i].Value >>= newValue;
2449 if ( oldValue != newValue )
2452 changedProps.push_back( aNewProps[
i] );
2458 changedProps.push_back( aNewProps[
i] );
2463 pInfo->SetCmisProperties( aModifiedProps );
2475 const SfxDocumentInfoItem& rInfoItem = rItemSet->
Get(SID_DOCINFO);
2476 uno::Sequence< document::CmisProperty > aCmisProps = rInfoItem.GetCmisProperties();
2477 for (
auto& rCmisProp : asNonConstRange(aCmisProps) )
2482 rCmisProp.Updatable,
2484 rCmisProp.MultiValued,
2485 rCmisProp.OpenChoice,
2498 return std::make_unique<SfxCmisPropertiesPage>(pPage, pController, *rItemSet);
css::uno::Reference< css::lang::XComponent > m_xFrame
static const AllSettings & GetSettings()
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, const ILibreOfficeKitNotifier *pNotifier=nullptr)
std::unique_ptr< weld::Builder > m_xBuilder
void AddLine(const OUString &sId, const OUString &sName, const OUString &sType, const bool bUpdatable, const bool bRequired, const bool bMultiValude, const bool bOpenChoice, css::uno::Any &aChoices, css::uno::Any const &rAny)
CmisPropertiesWindow m_aPropertiesWin
std::unique_ptr< weld::ScrolledWindow > m_xScrolledWindow
CmisPropertiesControl(weld::Builder &rBuilder)
std::unique_ptr< weld::Container > m_xBox
std::vector< std::unique_ptr< CmisPropertyLine > > m_aCmisPropertiesLines
SvNumberFormatter m_aNumberFormatter
CmisPropertiesWindow(std::unique_ptr< weld::Container > xParent)
css::uno::Sequence< css::document::CmisProperty > GetCmisProperties() const
void AddLine(const OUString &sId, const OUString &sName, const OUString &sType, const bool bUpdatable, const bool bRequired, const bool bMultiValued, const bool bOpenChoice, css::uno::Any &aChoices, css::uno::Any const &rAny)
const OUString & GetValue() const
void SetCustomProperties(std::vector< std::unique_ptr< CustomProperty > > &&rProperties)
std::unique_ptr< CustomPropertiesWindow > m_xPropertiesWin
void Init(weld::Builder &rParent)
std::unique_ptr< weld::Container > m_xBody
CustomPropertiesControl()
void AddLine(css::uno::Any const &rAny)
std::unique_ptr< weld::Label > m_xName
std::unique_ptr< weld::Widget > m_xBox
~CustomPropertiesControl()
std::unique_ptr< weld::Label > m_xValue
std::unique_ptr< weld::ScrolledWindow > m_xVertScroll
std::unique_ptr< weld::Label > m_xType
std::unique_ptr< SvtCalendarBox > m_xDateField
~CustomPropertiesDateField()
CustomPropertiesDateField(SvtCalendarBox *pDateField)
void set_date(const Date &rDate)
void set_visible(bool bVisible)
std::unique_ptr< weld::Entry > m_xEntry
void SetDuration(const css::util::Duration &rDuration)
css::util::Duration m_aDuration
void set_visible(bool bVisible)
~CustomPropertiesDurationField()
CustomPropertiesDurationField(std::unique_ptr< weld::Entry > xEntry, std::unique_ptr< weld::Button > xEditButton)
std::shared_ptr< DurationDialog_Impl > m_xDurationDialog
std::unique_ptr< weld::Button > m_xEditButton
CustomPropertiesTimeField(std::unique_ptr< weld::FormattedSpinButton > xTimeField)
std::unique_ptr< weld::TimeFormatter > m_xFormatter
void set_value(const tools::Time &rTime)
~CustomPropertiesTimeField()
tools::Time get_value() const
Link< void *, void > m_aRemovedHdl
css::uno::Sequence< css::beans::PropertyValue > GetCustomProperties()
~CustomPropertiesWindow()
void SetVisibleLineCount(sal_uInt32 nCount)
std::vector< std::unique_ptr< CustomPropertyLine > > m_aCustomPropertiesLines
sal_uInt16 GetTotalLineCount() const
weld::Label & m_rHeaderAccType
void ReloadLinesContent()
SvNumberFormatter m_aNumberFormatter
void AddLine(const OUString &sName, css::uno::Any const &rAny)
CustomPropertyLine * m_pCurrentLine
void StoreCustomProperties()
void Remove(const CustomPropertyLine *pLine)
weld::Label & m_rHeaderAccValue
weld::Label & m_rHeaderAccName
sal_uInt16 GetExistingLineCount() const
bool IsLineValid(CustomPropertyLine *pLine) const
bool AreAllLinesValid() const
void SetCustomProperties(std::vector< std::unique_ptr< CustomProperty > > &&rProperties)
weld::Container & m_rBody
void BoxLoseFocus(CustomPropertyLine *pLine)
void ValidateLine(CustomPropertyLine *pLine, bool bIsFromTypeBox)
Idle m_aEditLoseFocusIdle
void EditLoseFocus(CustomPropertyLine *pLine)
sal_uInt32 GetCurrentDataModelPosition() const
std::vector< std::unique_ptr< CustomProperty > > m_aCustomProperties
CustomPropertiesWindow(weld::Container &rParent, weld::Label &rHeaderAccName, weld::Label &rHeaderAccType, weld::Label &rHeaderAccValue)
void DoScroll(sal_Int32 nNewPos)
css::util::DateTime GetUNODateTime() const
sal_Int16 GetYear() const
sal_uInt16 GetDay() const
sal_uInt16 GetMonth() const
std::unique_ptr< weld::SpinButton > m_xHourNF
std::unique_ptr< weld::CheckButton > m_xNegativeCB
std::unique_ptr< weld::SpinButton > m_xMinuteNF
std::unique_ptr< weld::SpinButton > m_xMSecondNF
std::unique_ptr< weld::SpinButton > m_xDayNF
DurationDialog_Impl(weld::Widget *pParent, const css::util::Duration &rDuration)
css::util::Duration GetDuration() const
std::unique_ptr< weld::SpinButton > m_xSecondNF
std::unique_ptr< weld::SpinButton > m_xYearNF
std::unique_ptr< weld::SpinButton > m_xMonthNF
bool removeSegment(sal_Int32 nIndex=LAST_SEGMENT, bool bIgnoreFinalSlash=true)
OUString PathToFileName() const
virtual void Start(bool bStartTimer=true) override
OUString getDuration(const tools::Duration &rDuration, bool bSec=true, bool b100Sec=false) const
OUString getDate(const Date &rDate) const
OUString getNum(sal_Int64 nNumber, sal_uInt16 nDecimals, bool bUseThousandSep=true, bool bTrailingZeros=true) const
const OUString & getFalseWord() const
OUString getTime(const tools::Time &rTime, bool bSec=true, bool b100Sec=false) const
const OUString & getTrueWord() const
const OUString & getNumDecimalSep() const
SfxCmisPropertiesPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &)
std::unique_ptr< CmisPropertiesControl > m_xPropertiesCtrl
virtual ~SfxCmisPropertiesPage() override
virtual bool FillItemSet(SfxItemSet *) override
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *)
virtual void Reset(const SfxItemSet *) override
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
static sal_Int64 GetSize(std::u16string_view rContent)
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
virtual bool FillItemSet(SfxItemSet *) override
std::unique_ptr< weld::Button > m_xAdd
virtual ~SfxCustomPropertiesPage() override
virtual void Reset(const SfxItemSet *) override
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *)
SfxCustomPropertiesPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &)
std::unique_ptr< CustomPropertiesControl > m_xPropertiesCtrl
std::unique_ptr< weld::Entry > m_xKeywordsEd
std::unique_ptr< weld::TextView > m_xCommentEd
SfxDocumentInfoItem * m_pInfoItem
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *)
virtual ~SfxDocumentDescPage() override
std::unique_ptr< weld::Entry > m_xThemaEd
virtual void Reset(const SfxItemSet *) override
SfxDocumentDescPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &)
std::unique_ptr< weld::Entry > m_xTitleEd
virtual bool FillItemSet(SfxItemSet *) override
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *set)
virtual void PageCreated(const OUString &rId, SfxTabPage &rPage) override
SfxDocumentInfoDialog(weld::Window *pParent, const SfxItemSet &)
SfxDocumentPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &)
std::unique_ptr< weld::Label > m_xNameED
std::unique_ptr< weld::Label > m_xChangeValFt
std::unique_ptr< weld::LinkButton > m_xFileValEd
std::unique_ptr< weld::Button > m_xSignatureBtn
std::unique_ptr< weld::ComboBox > m_xImagePreferredDpiComboBox
std::unique_ptr< weld::Label > m_xShowTypeFT
VclPtr< AbstractPasswordToOpenModifyDialog > m_xPasswordDialog
std::unique_ptr< weld::Image > m_xBmp
virtual ~SfxDocumentPage() override
std::unique_ptr< weld::Label > m_xCreateValFt
void ImplCheckPasswordState()
std::unique_ptr< weld::Label > m_xShowSizeFT
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *)
std::unique_ptr< weld::CheckButton > m_xUseUserDataCB
std::unique_ptr< weld::Label > m_xTemplValFt
virtual bool FillItemSet(SfxItemSet *) override
virtual void Reset(const SfxItemSet *) override
std::unique_ptr< weld::Label > m_xDocNoValFt
std::unique_ptr< weld::Button > m_xDeleteBtn
OUString m_aMultiSignedStr
std::unique_ptr< weld::Button > m_xChangePassBtn
std::unique_ptr< weld::CheckButton > m_xUseThumbnailSaveCB
std::unique_ptr< weld::Label > m_xTemplFt
std::unique_ptr< weld::Label > m_xSignedValFt
void ImplUpdateSignatures()
std::unique_ptr< weld::Label > m_xPrintValFt
std::unique_ptr< weld::CheckButton > m_xImagePreferredDpiCheckButton
std::unique_ptr< weld::Label > m_xTimeLogValFt
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
const std::shared_ptr< const SfxFilter > & GetFilter() const
SfxItemSet & GetItemSet() const
const OUString & GetName() const
css::uno::Reference< css::embed::XStorage > GetStorage(bool bCreateTempFile=true)
SAL_DLLPRIVATE css::uno::Reference< css::embed::XStorage > const & GetZipStorageToSign_Impl(bool bReadOnly=true)
bool SignDocumentContent(weld::Window *pDialogParent)
SfxMedium * GetMedium() const
css::uno::Reference< css::frame::XModel3 > GetModel() const
static SAL_WARN_UNUSED_RESULT SfxObjectShell * Current()
virtual void SetModified(bool bModified=true)
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *)
SfxViewShell * GetViewShell() const
Returns the SfxViewShell in which they are located in the subshells.
void AddTabPage(const OUString &rName, CreateTabPage pCreateFunc, GetTabPageRanges pRangesFunc)
void RemoveTabPage(const OUString &rName)
SfxOkDialogController * GetDialogController() const
const SfxItemSet * GetDialogExampleSet() const
const css::uno::Any & GetValue() const
virtual void libreOfficeKitViewCallback(int nType, const OString &pPayload) const override
Invokes the registered callback, if there are any.
constexpr tools::Long Height() const
constexpr tools::Long Width() const
bool LookupDisabled(const OUString &aCommandURL) const
const LocaleDataWrapper & GetLocaleData() const
void SetPriority(TaskPriority ePriority)
void SetInvokeHandler(const Link< Timer *, void > &rLink)
virtual VclPtr< AbstractPasswordToOpenModifyDialog > CreatePasswordToOpenModifyDialog(weld::Window *pParent, sal_uInt16 nMaxPasswdLen, bool bIsPasswordToModify)=0
static VclAbstractDialogFactory * Create()
virtual std::unique_ptr< ScrolledWindow > weld_scrolled_window(const OUString &id, bool bUserManagedScrolling=false)=0
virtual std::unique_ptr< Container > weld_container(const OUString &id)=0
virtual std::unique_ptr< Label > weld_label(const OUString &id)=0
virtual std::unique_ptr< Widget > weld_widget(const OUString &id)=0
virtual OUString get_active_id() const=0
void append(const weld::ComboBoxEntry &rItem)
virtual void set_active(int pos)=0
void append_text(const OUString &rStr)
static bool runAsync(const std::shared_ptr< DialogController > &rController, const std::function< void(sal_Int32)> &)
std::shared_ptr< weld::Dialog > m_xDialog
virtual OUString get_label() const=0
#define DBG_ASSERT(sCon, aError)
#define TOOLS_WARN_EXCEPTION(area, stream)
weld::Window * GetFrameWeld(const SfxFrame *pFrame)
IMPL_LINK(CustomPropertiesDurationField, ClickHdl, weld::Button &, rButton, void)
IMPL_LINK_NOARG(SfxDocumentPage, DeleteHdl, weld::Button &, void)
#define LINK(Instance, Class, Member)
#define SAL_WARN(area, stream)
#define SAL_N_ELEMENTS(arr)
#define MID_DOCINFO_DELETEUSERDATA
#define MID_DOCINFO_AUTOLOADSECS
#define MID_DOCINFO_TITLE
#define MID_DOCINFO_KEYWORDS
#define MID_DOCINFO_SUBJECT
#define MID_DOCINFO_DEFAULTTARGET
#define MID_DOCINFO_AUTOLOADENABLED
#define MID_DOCINFO_USEUSERDATA
#define MID_DOCINFO_AUTOLOADURL
#define MID_DOCINFO_USETHUMBNAILSAVE
#define MID_DOCINFO_DESCRIPTION
const LanguageTag & getLocale()
OUString convertCommaSeparated(uno::Sequence< OUString > const &i_rSeq)
OString stripStart(const OString &rIn, char c)
OUString GetContentPart(const OUString &_rRawString, const css::security::CertificateKind &rKind)
bool ContainerUniquePtrEquals(C< std::unique_ptr< T >, Etc... > const &lhs, C< std::unique_ptr< T >, Etc... > const &rhs)
css::uno::Sequence< DstElementType > containerToSequence(const SrcType &i_Container)
Reference< XComponentContext > getProcessComponentContext()
std::u16string_view getTitle(std::u16string_view aPath)
const LocaleDataWrapper & GetLocaleDataWrapper(LanguageType nLang)
bool IsMSType(const std::shared_ptr< const SfxFilter > &pCurrentFilter)
bool IsOOXML(const std::shared_ptr< const SfxFilter > &pCurrentFilter)
ErrCode SetPassword(const std::shared_ptr< const SfxFilter > &pCurrentFilter, SfxItemSet *pSet, const OUString &rPasswordToOpen, std::u16string_view rPasswordToModify, bool bAllowPasswordReset)
ErrCode RequestPassword(const std::shared_ptr< const SfxFilter > &pCurrentFilter, OUString const &aURL, SfxItemSet *pSet, const css::uno::Reference< css::awt::XWindow > &rParent)
OUString GetDateTimeString(const css::util::DateTime &_rDT)
Sequence< Property > aInfos
OUString SfxResId(TranslateId aId)
#define CMIS_TYPE_DATETIME
constexpr OUStringLiteral CMIS_TYPE_STRING
#define CMIS_TYPE_INTEGER
#define CMIS_TYPE_DECIMAL
CmisDateTime(weld::Widget *pParent, const css::util::DateTime &rDateTime)
std::unique_ptr< weld::FormattedSpinButton > m_xTimeField
std::unique_ptr< weld::TimeFormatter > m_xFormatter
std::unique_ptr< SvtCalendarBox > m_xDateField
std::vector< std::unique_ptr< CmisYesNo > > m_aYesNos
CmisPropertyLine(weld::Widget *pParent)
std::vector< std::unique_ptr< CmisValue > > m_aValues
std::unique_ptr< weld::Label > m_xType
std::unique_ptr< weld::Frame > m_xFrame
std::vector< std::unique_ptr< CmisDateTime > > m_aDateTimes
std::unique_ptr< weld::Label > m_xName
std::unique_ptr< weld::Entry > m_xValueEdit
CmisValue(weld::Widget *pParent, const OUString &rStr)
CmisYesNo(weld::Widget *pParent, bool bValue)
std::unique_ptr< weld::RadioButton > m_xNoButton
std::unique_ptr< weld::RadioButton > m_xYesButton
std::unique_ptr< CustomPropertiesYesNoButton > m_xYesNoButton
std::unique_ptr< CustomPropertiesTimeField > m_xTimeField
std::unique_ptr< weld::Button > m_xRemoveButton
std::unique_ptr< weld::Widget > m_xDateTimeBox
std::unique_ptr< weld::Container > m_xLine
CustomPropertyLine(CustomPropertiesWindow *pParent, weld::Widget *pContainer)
std::unique_ptr< weld::Entry > m_xValueEdit
std::unique_ptr< weld::ComboBox > m_xNameBox
std::unique_ptr< weld::Widget > m_xDurationBox
std::unique_ptr< CustomPropertiesDurationField > m_xDurationField
std::unique_ptr< CustomPropertiesDateField > m_xDateField
std::unique_ptr< weld::ComboBox > m_xTypeBox
void DoTypeHdl(const weld::ComboBox &rBox)
CustomProperty(OUString sName, css::uno::Any aValue)
bool operator==(const CustomProperty &rProp) const
constexpr sal_uInt32 NUMBERFORMAT_ENTRY_NOT_FOUND