1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef __com_sun_star_ucb_ContentAction_idl__
20 #define __com_sun_star_ucb_ContentAction_idl__
24 module com
{ module sun
{ module star
{ module ucb
{
26 /** specifies actions which can be transported with content events.
29 The situations under which contents will send ContentEvents of the various
30 action types are described below. The description is broken into a list of
31 useful definitions, a list of events that happen to contents, and a list of
32 reactions taken by contents in response to those events.
36 The definitions are as follows:
40 <tr><td>D1</td><td>A content C has an identifier id(C).</td></tr>
41 <tr><td>D2</td><td>A content C is in one of two states, Alive or Deleted.
43 <tr><td>D3</td><td>A folder content F has a set of children H(F) that is a
44 set of content identifiers. For example, an "open"
45 command will usually return a subset of the contents
46 denoted by H(F).</td></tr>
50 The events that can happen to contents (and that are of interest in this
51 context) are listed next. Note that "event" here does not mean an
52 ContentEvent, but rather some event that occurs either because some content
53 processes a command, or because a content gets informed about a relevant
54 change in the underlying system it represents.
58 <tr><td>E1</td><td>The identifier of a content C changes from id1(C) == A
59 to id2(C) == B, denoted as E1(C: A->B). For example,
60 this event may occur when content C processes a
61 "setPropertyValues" command changing its "Title" property,
62 or when a folder that hierarchically contains C changes
63 its identity.</td></tr>
64 <tr><td>E2</td><td>The state of a content C changes from Alive to Deleted,
65 denoted as E2(C). For example, this event may occur when
66 content C processes a "delete" command, or when a content
67 representing an IMAP message gets informed by the IMAP
68 server that the message has been deleted.</td></tr>
69 <tr><td>E3</td><td>The set of children of a folder content F is enlarged by
70 some identifier A (that was not previously in that set,
71 i.e., !(A in H1(F)) && (A in H2(F))), denoted as E3(F, A).
72 For example, this event may occur when a new content
73 created at folder F processes its "insert" command, or
74 when a folder representing an IMAP mailbox gets informed
75 by the IMAP server that a new message has arrived at that
80 Finally, the list of reactions taken by contents in response to the above
81 events gives a description of what kinds of ContentEvents are sent in which
86 <tr><td>R1</td><td>E1(C: A->B) results in C sending an EXCHANGED
87 ContentEvent, which then results in the following: All
88 folders F that used to have A as a child, but will not
89 have B as a child, i.e., (A in H1(F)) && !(B in H2(F)),
90 send a REMOVED ContentEvent.</td></tr>
91 <tr><td>R2</td><td>E2(C) results in C sending a DELETED ContentEvent,
92 which then results in the following: All folders F that
93 used to have A as a child, but will not continue to have
94 A as a child, i.e., (A in H1(F)) && !(A in H2(F)), send
95 a REMOVED event.</td></tr>
96 <tr><td>R3</td><td>E3(F, A) results in F sending an INSERTED event.</td></tr>
99 published constants ContentAction
101 /** A content was inserted into a folder content (i.e., while updating the
104 <p>This action must be notified at the listeners of the folder content.
106 const long INSERTED
= 0;
108 /** A content was removed from a folder content, but not physically
109 destroyed (i.e., due to rules just applied to the folder).
111 <p>This action must be notified at the listeners of the folder content.
113 const long REMOVED
= 1;
115 /** A content was physically destroyed.
117 <p>Events containing this action may be generated at any time. So a
118 content event listener should be prepared to get notified the "death"
119 of the related content!
121 <p>This action must be notified at the listeners of the deleted
124 const long DELETED
= 2;
126 /** This Action indicates that a content has changed its identity (i.e.
127 after renaming a file system folder).
129 <p>This action must be notified at the listeners of the exchanged
132 const long EXCHANGED
= 4;
134 /** This is obsolete and should no longer be used.
138 const long SEARCH_MATCHED
= 128;
147 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */