Difference between revisions of "Zh/Documentation/DevGuide/Extensions/Location of Installed Extensions"
From Apache OpenOffice Wiki
< Zh | Documentation
m (New page: {{Documentation/DevGuide/ExtensionsTOC/Zh |Extensions2a=block |ShowPrevNext=block |PrevPage=Zh/Documentation/DevGuide/Extensions/unopkg |NextPage=Zh/Documentation/DevGuide/Extensions/Exten...) |
m |
||
Line 18: | Line 18: | ||
xInfoProvider( css::deployment::PackageInformationProvider::get( mxContext ) ); | xInfoProvider( css::deployment::PackageInformationProvider::get( mxContext ) ); | ||
− | // "MY_PACKAGE_ID" is the identifier of the package | + | // "MY_PACKAGE_ID" is the identifier of the package whose location we want |
rtl::OUString sLocation = xInfoProvider->getPackageLocation( | rtl::OUString sLocation = xInfoProvider->getPackageLocation( | ||
rtl::OUString::createFromAscii( "MY_PACKAGE_ID" ) ); | rtl::OUString::createFromAscii( "MY_PACKAGE_ID" ) ); |
Latest revision as of 05:34, 19 September 2008
有时扩展开发者需要了解扩展安装位置的根目录路径,比如说读取一些额外数据。PackageInformationProvider
可以用给定的扩展标识符来获取的一个表示扩展安装路径的 URL。欲了解更多扩展标识符信息,请参阅 扩展标识符。详见 com.sun.star.deployment.PackageInformationProvider 并参阅 com.sun.star.deployment.XPackageInformationProvider。
... namespace css = com::sun::star; css::uno::Reference< css::uno::XComponentContext > mxContext; ... css::uno::Reference< css::deployment::XPackageInformationProvider > xInfoProvider( css::deployment::PackageInformationProvider::get( mxContext ) ); // "MY_PACKAGE_ID" is the identifier of the package whose location we want rtl::OUString sLocation = xInfoProvider->getPackageLocation( rtl::OUString::createFromAscii( "MY_PACKAGE_ID" ) ); ...
Content on this page is licensed under the Public Documentation License (PDL). |