Difference between revisions of "Documentation/DevGuide/WritingUNO/Writing the Specification"

From Apache OpenOffice Wiki
Jump to: navigation, search
m (1 revision(s))
m (FINAL VERSION FOR L10N)
(6 intermediate revisions by 3 users not shown)
Line 6: Line 6:
 
|NextPage=Documentation/DevGuide/WritingUNO/Preprocessing
 
|NextPage=Documentation/DevGuide/WritingUNO/Preprocessing
 
}}
 
}}
 +
{{Documentation/DevGuideLanguages|Documentation/DevGuide/WritingUNO/{{SUBPAGENAME}}}}
 
{{DISPLAYTITLE:Writing the Specification}}
 
{{DISPLAYTITLE:Writing the Specification}}
 
There are similarities between C++, CORBA IDL and UNOIDL, especially concerning the syntax and the general usage of the compiler. If you are familiar with reading C++ or CORBA IDL, you will be able to understand much of UNOIDL, as well.
 
There are similarities between C++, CORBA IDL and UNOIDL, especially concerning the syntax and the general usage of the compiler. If you are familiar with reading C++ or CORBA IDL, you will be able to understand much of UNOIDL, as well.
  
 
As a first example, consider the IDL specification for the <idl>com.sun.star.bridge.XUnoUrlResolver</idl> interface. An idl file usually starts with a number of preprocessor directives, followed by module instructions and a type definition:
 
As a first example, consider the IDL specification for the <idl>com.sun.star.bridge.XUnoUrlResolver</idl> interface. An idl file usually starts with a number of preprocessor directives, followed by module instructions and a type definition:
 
+
<source lang="idl">
 
   #ifndef __com_sun_star_bridge_XUnoUrlResolver_idl__  
 
   #ifndef __com_sun_star_bridge_XUnoUrlResolver_idl__  
 
   #define __com_sun_star_bridge_XUnoUrlResolver_idl__  
 
   #define __com_sun_star_bridge_XUnoUrlResolver_idl__  
Line 40: Line 41:
 
    
 
    
 
   #endif  
 
   #endif  
 
+
</source>
 
We will discuss this idl file step by step below, and we will write our own UNOIDL specification as soon as possible. The file specifying <idl>com.sun.star.bridge.XUnoUrlResolver</idl> is located in the ''idl'' folder of your SDK installation, ''<SDK>/idl/com/sun/star/bridge/XUnoUrlResolver.idl''.  
 
We will discuss this idl file step by step below, and we will write our own UNOIDL specification as soon as possible. The file specifying <idl>com.sun.star.bridge.XUnoUrlResolver</idl> is located in the ''idl'' folder of your SDK installation, ''<SDK>/idl/com/sun/star/bridge/XUnoUrlResolver.idl''.  
  
Line 46: Line 47:
  
 
{{PDL1}}
 
{{PDL1}}
[[Category: Writing UNO Components]]
+
 
 +
[[Category:Documentation/Developer's Guide/Writing UNO Components]]

Revision as of 08:45, 13 May 2009



There are similarities between C++, CORBA IDL and UNOIDL, especially concerning the syntax and the general usage of the compiler. If you are familiar with reading C++ or CORBA IDL, you will be able to understand much of UNOIDL, as well.

As a first example, consider the IDL specification for the com.sun.star.bridge.XUnoUrlResolver interface. An idl file usually starts with a number of preprocessor directives, followed by module instructions and a type definition:

  #ifndef __com_sun_star_bridge_XUnoUrlResolver_idl__ 
  #define __com_sun_star_bridge_XUnoUrlResolver_idl__ 
 
  #include <com/sun/star/uno/XInterface.idl> 
  #include <com/sun/star/lang/IllegalArgumentException.idl> 
  #include <com/sun/star/connection/ConnectionSetupException.idl> 
  #include <com/sun/star/connection/NoConnectException.idl> 
 
 
  module com { module sun { module star { module bridge {
 
 
  /** service <type scope="com::sun::star::bridge">UnoUrlResolver</type> 
          implements this interface.
   */
  published interface XUnoUrlResolver: com::sun::star::uno::XInterface
  { 
      // method com::sun::star::bridge::XUnoUrlResolver::resolve
      /** resolves an object, on the UNO URL.
       */
      com::sun::star::uno::XInterface resolve( [in] string sUnoUrl ) 
          raises (com::sun::star::connection::NoConnectException, 
                  com::sun::star::connection::ConnectionSetupException, 
                  com::sun::star::lang::IllegalArgumentException); 
  }; 
 
  }; }; }; };
 
  #endif

We will discuss this idl file step by step below, and we will write our own UNOIDL specification as soon as possible. The file specifying com.sun.star.bridge.XUnoUrlResolver is located in the idl folder of your SDK installation, <SDK>/idl/com/sun/star/bridge/XUnoUrlResolver.idl.

UNOIDL definition file names have the extension . idl by convention. The descriptions must use the US ASCII character set without special characters and separate symbols by whitespace, i.e. blanks, tabs or linefeeds.

Content on this page is licensed under the Public Documentation License (PDL).
Personal tools
In other languages