22 #include <com/sun/star/awt/PushButtonType.hpp>
23 #include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
24 #include <com/sun/star/util/URL.hpp>
25 #include <com/sun/star/util/URLTransformer.hpp>
26 #include <com/sun/star/util/XURLTransformer.hpp>
27 #include <rtl/ustrbuf.hxx>
30 #define DIALOG_WIDTH 240
31 #define DIALOG_HEIGHT 80
33 #define PAGE_WIDTH ( DIALOG_WIDTH - PAGE_POS_X ) - 6
48 sal_Int32 nXPos, sal_Int32 nYPos, sal_Int32 nWidth, sal_Int32 nHeight,
bool bMultiLine, sal_Int16 nTabIndex )
53 OUString(
"MultiLine"),
54 OUString(
"PositionX"),
55 OUString(
"PositionY"),
73 Sequence< Any > aValues( pValues, nCount );
81 const OUString& rControlName,
93 OUString(
"PositionX"),
94 OUString(
"PositionY"),
95 OUString(
"ScaleImage"),
99 Any( sal_Int16( 0 ) ),
109 Sequence< Any > aValues( pValues, nCount );
111 rInformationDialog.
insertImage( rControlName, aNames, aValues );
116 const Reference< XItemListener >& rItemListener,
const OUString& rLabel,
117 sal_Int32 nXPos, sal_Int32 nYPos, sal_Int32 nWidth, sal_Int16 nTabIndex )
119 sal_Int32 nHeight = 8;
120 OUString pNames[] = {
124 OUString(
"PositionX"),
125 OUString(
"PositionY"),
127 OUString(
"TabIndex"),
143 Sequence< Any > aValues( pValues, nCount );
145 Reference< XCheckBox > xCheckBox( rInformationDialog.
insertCheckBox( rControlName, aNames, aValues ) );
146 if ( rItemListener.is() )
147 xCheckBox->addItemListener( rItemListener );
151 OUString
InsertButton(
UnoDialog& rInformationDialog,
const OUString& rControlName, Reference< XActionListener >
const & xActionListener,
152 sal_Int32 nXPos, sal_Int32 nYPos, sal_Int32 nWidth, sal_Int16 nTabIndex,
const OUString& rText )
154 sal_Int32 nHeight = 14;
155 OUString pNames[] = {
159 OUString(
"PositionX"),
160 OUString(
"PositionY"),
161 OUString(
"PushButtonType"),
163 OUString(
"TabIndex"),
172 Any( static_cast< sal_Int16 >( PushButtonType_OK ) ),
181 Sequence< Any > aValues( pValues, nCount );
183 rInformationDialog.
insertButton( rControlName, xActionListener, aNames, aValues );
190 double fVal( static_cast<double>( rVal ) );
193 OUStringBuffer aVal( OUString::number( fVal ) );
194 sal_Int32 nX( aVal.indexOf(
'.' ) );
196 aVal.setLength( nX + 2 );
197 return aVal.makeStringAndClear();
207 OUString pNames[] = {
208 OUString(
"Closeable"),
210 OUString(
"Moveable"),
211 OUString(
"PositionX"),
212 OUString(
"PositionY"),
218 Any( nDialogHeight ),
220 Any( sal_Int32( 245 ) ),
221 Any( sal_Int32( 115 ) ),
228 Sequence< Any > aValues( pValues, nCount );
258 util::URL
aURL, aPresentationURL;
260 xURLTransformer->parseSmart( aURL, OUString() );
262 static const OUStringLiteral sFileProtocol(
u"file:///" );
263 aPresentationURL.Complete = sFileProtocol + aURL.Name;
264 aTitle = xURLTransformer->getPresentation( aPresentationURL,
false );
266 if ( aTitle.match( sFileProtocol ) )
267 aTitle = aTitle.replaceAt( 0, sFileProtocol.getLength(),
u"" );
270 OUString aInfoString(
getString( eInfoString ) );
271 static const OUStringLiteral aOldSizePlaceholder(
u"%OLDFILESIZE" );
272 static const OUStringLiteral aNewSizePlaceholder(
u"%NEWFILESIZE" );
273 const OUString aTitlePlaceholder( !aTitle.isEmpty() ? OUString(
"%TITLE" )
274 : OUString(
"'%TITLE'") );
276 sal_Int32
i = aInfoString.indexOf( aOldSizePlaceholder );
278 aInfoString = aInfoString.replaceAt( i, aOldSizePlaceholder.getLength(),
ImpValueOfInMB( nSource ) );
280 sal_Int32 j = aInfoString.indexOf( aNewSizePlaceholder );
282 aInfoString = aInfoString.replaceAt( j, aNewSizePlaceholder.getLength(),
ImpValueOfInMB( nDest ) );
284 sal_Int32 k = aInfoString.indexOf( aTitlePlaceholder );
286 aInfoString = aInfoString.replaceAt( k, aTitlePlaceholder.getLength(), aTitle );
288 css::uno::Reference< css::awt::XItemListener > xItemListener;
291 "private:standardimage/query",
292 5, 5, 25, 25,
false );
307 mnSourceSize( rSourceSize ),
308 mnDestSize( rDestSize ),
309 mnApproxSize( rApproxSize ),
310 mrbOpenNewDocument( rbOpenNewDocument ),
311 maSaveAsURL( rSaveAsURL )
328 sal_Int16 nInt16 = 0;
330 if ( aAny >>= nInt16 )
332 bool bOpenNewDocument =
static_cast< bool >( nInt16 );
341 if ( rEvent.ActionCommand ==
"button" )
css::uno::Any getControlProperty(const OUString &rControlName, const OUString &rPropertyName)
css::uno::Reference< css::awt::XControl > insertImage(const OUString &rName, const css::uno::Sequence< OUString > &rPropertyNames, const css::uno::Sequence< css::uno::Any > &rPropertyValues)
void setPropertyValues(const css::uno::Sequence< OUString > &rNameSeq, const css::uno::Sequence< css::uno::Any > &rValueSeq)
void setControlProperty(const OUString &rControlName, const OUString &rPropertyName, const css::uno::Any &rPropertyValue)
#define SAL_N_ELEMENTS(arr)
css::uno::Reference< css::awt::XFixedText > insertFixedText(const OUString &rName, const css::uno::Sequence< OUString > &rPropertyNames, const css::uno::Sequence< css::uno::Any > &rPropertyValues)
OUString getString(const PPPOptimizerTokenEnum) const
void endExecute(bool bStatus)
virtual void SAL_CALL actionPerformed(const css::awt::ActionEvent &Event) override
css::uno::Reference< css::uno::XComponentContext > mxContext
css::uno::Reference< css::awt::XCheckBox > insertCheckBox(const OUString &rName, const css::uno::Sequence< OUString > &rPropertyNames, const css::uno::Sequence< css::uno::Any > &rPropertyValues)
const PropertyValue * pValues
virtual void SAL_CALL disposing(const css::lang::EventObject &Source) override
css::uno::Reference< css::awt::XButton > insertButton(const OUString &rName, const css::uno::Reference< css::awt::XActionListener > &xActionListener, const css::uno::Sequence< OUString > &rPropertyNames, const css::uno::Sequence< css::uno::Any > &rPropertyValues)