On 04/07/2016 07:55 AM, Christian Giehl wrote:
Hi,

I'm currently working on a custom toolbar for my oo-extension. To create the visual appearance of the toolbar, I have to write an Addons.xcu file, which contains a custom xml. However, the tag names and attributes I found in the tutorial all across the www are not sufficient for my case and I stumbled accross tags I never encountered anywhere before, e.g.

<prop oor:name="ImageSmallHCURL">
 <value/>
</prop>
<prop oor:name="ImageBigHCURL">
 <value/>
</prop>

You can include 4 icons for the toolbar, these are for High Contrast.

The big one should be 26 x 26 and the small one 16 x 16.

Same for the two low contrast ones.


or some attributes like oor:op="replace".

Since I can't reliably figure out what these tags/attributes represent and how they are used I am in need for some kind of documentation. The only ref I've found so far is (https://wiki.openoffice.org/wiki/Documentation/DevGuide/WritingUNO/AddOns/Toolbars), but not all props/tags/attrs are listed there.

I wonder if anyone of you guys can tell me how I can approach to these kinds of problems better. Is there a reference documentation I haven't found yet? How do I gain a clearer understanding of those tags without a documentation? I beg nobody says reverse engineering :D

Thanks in advance!

Chris

Hi Chris,

I'm not aware of a schema published anywhere but perhaps someone else may.

In the mean time I generated a sample Addons.xcu with the NetBeans plugin with some examples filled in.

To make it simpler I'll just post the text below..
----------

<?xml version='1.0' encoding='UTF-8'?>

<oor:component-data xmlns:oor="http://openoffice.org/2001/registry"; xmlns:xs="http://www.w3.org/2001/XMLSchema"; oor:name="Addons" oor:package="org.openoffice.Office">
  <node oor:name="AddonUI">
    <node oor:name="OfficeMenuBar">
      <node oor:name="com.example.nbaddon" oor:op="replace">
        <prop oor:name="Title" oor:type="xs:string">
          <value/>
          <value xml:lang="en">AddOn Menu</value>
        </prop>
        <prop oor:name="Target" oor:type="xs:string">
          <value>_self</value>
        </prop>
        <prop oor:name="ImageIdentifier" oor:type="xs:string">
          <value/>
        </prop>
        <node oor:name="Submenu">
          <node oor:name="m1" oor:op="replace">
            <prop oor:name="URL" oor:type="xs:string">
<value>com.example.nbaddon:Command0</value>
            </prop>
            <prop oor:name="ImageIdentifier" oor:type="xs:string">
              <value/>
            </prop>
            <prop oor:name="Target" oor:type="xs:string">
              <value>_self</value>
            </prop>
            <prop oor:name="Context" oor:type="xs:string">
              <value/>
            </prop>
            <prop oor:name="Title" oor:type="xs:string">
              <value/>
              <value xml:lang="en">Command0</value>
            </prop>
          </node>
        </node>
      </node>
    </node>
    <node oor:name="OfficeToolBar">
      <node oor:name="com.example.nbaddon" oor:op="replace">
        <prop oor:name="Title" oor:type="xs:string" oor:localized="true">
          <value xml:lang="en">Dummy</value>
        </prop>
        <node oor:name="ToolBarItems">
      <node oor:name="m1" oor:op="replace">
        <prop oor:name="URL" oor:type="xs:string">
          <value>com.example.nbaddon:Command0</value>
        </prop>
        <prop oor:name="ImageIdentifier" oor:type="xs:string">
          <value/>
        </prop>
        <prop oor:name="Target" oor:type="xs:string">
          <value>_self</value>
        </prop>
        <prop oor:name="Context" oor:type="xs:string">
<value>com.sun.star.frame.Bibliography,com.sun.star.chart.ChartDocument,com.sun.star.sdb.OfficeDatabaseDocument,com.sun.star.drawing.DrawingDocument,com.sun.star.formula.FormulaProperties,com.sun.star.presentation.PresentationDocument,com.sun.star.sheet.SpreadsheetDocument,com.sun.star.text.TextDocument,com.sun.star.text.GlobalDocument</value>
        </prop>
        <prop oor:name="Title" oor:type="xs:string">
          <value/>
          <value xml:lang="en">Command0</value>
        </prop>
      </node>
        </node>
      </node>
    </node>
    <node oor:name="Images">
<node oor:name="com.example.nbaddon.command0.images" oor:op="replace">
        <prop oor:name="URL" oor:type="xs:string">
          <value>com.example.nbaddon:Command0</value>
        </prop>
        <node oor:name="UserDefinedImages">
          <prop oor:name="ImageSmallURL">
            <value/>
          </prop>
          <prop oor:name="ImageBigURL">
            <value/>
          </prop>
          <prop oor:name="ImageSmallHCURL">
<value>%origin%/../../../../../images/edit-cut.png</value>
          </prop>
          <prop oor:name="ImageBigHCURL">
            <value/>
          </prop>
        </node>
      </node>
      </node>
  </node>
</oor:component-data>

------

Please let me know if you have any questions.

Thanks,
Carl


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to