1*d1766043SAndrew Rist/************************************************************** 2cdf0e10cSrcweir * 3*d1766043SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*d1766043SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*d1766043SAndrew Rist * distributed with this work for additional information 6*d1766043SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*d1766043SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*d1766043SAndrew Rist * "License"); you may not use this file except in compliance 9*d1766043SAndrew Rist * with the License. You may obtain a copy of the License at 10*d1766043SAndrew Rist * 11*d1766043SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*d1766043SAndrew Rist * 13*d1766043SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*d1766043SAndrew Rist * software distributed under the License is distributed on an 15*d1766043SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*d1766043SAndrew Rist * KIND, either express or implied. See the License for the 17*d1766043SAndrew Rist * specific language governing permissions and limitations 18*d1766043SAndrew Rist * under the License. 19*d1766043SAndrew Rist * 20*d1766043SAndrew Rist *************************************************************/ 21*d1766043SAndrew Rist 22*d1766043SAndrew Rist 23cdf0e10cSrcweir#ifndef __com_sun_star_ucb_ContentAction_idl__ 24cdf0e10cSrcweir#define __com_sun_star_ucb_ContentAction_idl__ 25cdf0e10cSrcweir 26cdf0e10cSrcweir 27cdf0e10cSrcweir//============================================================================= 28cdf0e10cSrcweir 29cdf0e10cSrcweirmodule com { module sun { module star { module ucb { 30cdf0e10cSrcweir 31cdf0e10cSrcweir//============================================================================= 32cdf0e10cSrcweir/** specifies actions which can be transported with content events. 33cdf0e10cSrcweir 34cdf0e10cSrcweir <p> 35cdf0e10cSrcweir The situations under which contents will send ContentEvents of the various 36cdf0e10cSrcweir action types are described below. The description is broken into a list of 37cdf0e10cSrcweir useful definitions, a list of events that happen to contents, and a list of 38cdf0e10cSrcweir reactions taken by contents in response to those events. 39cdf0e10cSrcweir </p> 40cdf0e10cSrcweir 41cdf0e10cSrcweir <p> 42cdf0e10cSrcweir The definitions are as follows: 43cdf0e10cSrcweir </p> 44cdf0e10cSrcweir 45cdf0e10cSrcweir <table border =1> 46cdf0e10cSrcweir <tr><td>D1</td><td>A content C has an identifier id(C).</td></tr> 47cdf0e10cSrcweir <tr><td>D2</td><td>A content C is in one of two states, Alive or Deleted. 48cdf0e10cSrcweir </td></tr> 49cdf0e10cSrcweir <tr><td>D3</td><td>A folder content F has a set of children H(F) that is a 50cdf0e10cSrcweir set of content identifiers. For example, an "open" 51cdf0e10cSrcweir command will usualy return a subset of the contents 52cdf0e10cSrcweir denoted by H(F).</td></tr> 53cdf0e10cSrcweir </table> 54cdf0e10cSrcweir 55cdf0e10cSrcweir <p> 56cdf0e10cSrcweir The events that can happen to contents (and that are of interest in this 57cdf0e10cSrcweir context) are listed next. Note that 'event' here does not mean an 58cdf0e10cSrcweir ContentEvent, but rather some event that occurs either because some content 59cdf0e10cSrcweir processes a command, or because a content gets informed about a relevant 60cdf0e10cSrcweir change in the underlying system it represents. 61cdf0e10cSrcweir </p> 62cdf0e10cSrcweir 63cdf0e10cSrcweir <table border =1> 64cdf0e10cSrcweir <tr><td>E1</td><td>The identifier of a content C changes from id1(C) == A 65cdf0e10cSrcweir to id2(C) == B, denoted as E1(C: A->B). For example, 66cdf0e10cSrcweir this event may occur when content C processes a 67cdf0e10cSrcweir "setPropertyValues" command changing its "Title" propery, 68cdf0e10cSrcweir or when afolder that hierarchicaly contains C changes 69cdf0e10cSrcweir its identity.</td></tr> 70cdf0e10cSrcweir <tr><td>E2</td><td>The state of a content C changes from Alive to Deleted, 71cdf0e10cSrcweir denoted as E2(C). For example, this event may occur when 72cdf0e10cSrcweir content C processes a "delete" command, or when a content 73cdf0e10cSrcweir representing an IMAP message gets informed by the IMAP 74cdf0e10cSrcweir server that the message has been deleted.</td></tr> 75cdf0e10cSrcweir <tr><td>E3</td><td>The set of children of a folder content F is enlarged by 76cdf0e10cSrcweir some identifier A (that was not previously in that set, 77cdf0e10cSrcweir i.e., !(A in H1(F)) && (A in H2(F))), denoted as E3(F, A). 78cdf0e10cSrcweir For example, this event may occur when a new content 79cdf0e10cSrcweir created at folder F processes its "insert" command, or 80cdf0e10cSrcweir when a folder representing an IMAP mailbox gets informed 81cdf0e10cSrcweir by the IMAP server that a new message has arrived at that 82cdf0e10cSrcweir mailbox.</td></tr> 83cdf0e10cSrcweir </table> 84cdf0e10cSrcweir 85cdf0e10cSrcweir <p> 86cdf0e10cSrcweir Finally, the list of reactions taken by contents in response to the above 87cdf0e10cSrcweir events gives a description of what kinds of ContentEvents are sent in which 88cdf0e10cSrcweir situations: 89cdf0e10cSrcweir </p> 90cdf0e10cSrcweir 91cdf0e10cSrcweir <table border =1> 92cdf0e10cSrcweir <tr><td>R1</td><td>E1(C: A->B) results in C sending an EXCHANGED 93cdf0e10cSrcweir ContentEvent, which then results in the following: All 94cdf0e10cSrcweir folders F that used to have A as a child, but will not 95cdf0e10cSrcweir have B as a child, i.e., (A in H1(F)) && !(B in H2(F)), 96cdf0e10cSrcweir send a REMOVED ContentEvent.</td></tr> 97cdf0e10cSrcweir <tr><td>R2</td><td>E2(C) results in C sending a DELETED ContentEvent, 98cdf0e10cSrcweir which then results in the following: All folders F that 99cdf0e10cSrcweir used to have A as a child, but will not continue to have 100cdf0e10cSrcweir A as a child, i.e., (A in H1(F)) && !(A in H2(F)), send 101cdf0e10cSrcweir a REMOVED event.</td></tr> 102cdf0e10cSrcweir <tr><td>R3</td><td>E3(F, A) results in F sending an INSERTED event.</td></tr> 103cdf0e10cSrcweir </table> 104cdf0e10cSrcweir*/ 105cdf0e10cSrcweirpublished constants ContentAction 106cdf0e10cSrcweir{ 107cdf0e10cSrcweir //------------------------------------------------------------------------- 108cdf0e10cSrcweir /** A content was inserted into a folder content (i.e., while updating the 109cdf0e10cSrcweir folder). 110cdf0e10cSrcweir 111cdf0e10cSrcweir <p>This action must be notified at the listeners of the folder content. 112cdf0e10cSrcweir */ 113cdf0e10cSrcweir const long INSERTED = 0; 114cdf0e10cSrcweir 115cdf0e10cSrcweir //------------------------------------------------------------------------- 116cdf0e10cSrcweir /** A content was removed from a folder content, but not physically 117cdf0e10cSrcweir destroyed (i.e., due to rules just applied to the folder). 118cdf0e10cSrcweir 119cdf0e10cSrcweir <p>This action must be notified at the listeners of the folder content. 120cdf0e10cSrcweir */ 121cdf0e10cSrcweir const long REMOVED = 1; 122cdf0e10cSrcweir 123cdf0e10cSrcweir //------------------------------------------------------------------------- 124cdf0e10cSrcweir /** A content was physically destroyed. 125cdf0e10cSrcweir 126cdf0e10cSrcweir <p>Events containing this action may be generated at any time. So a 127cdf0e10cSrcweir content event listener should be prepared to get notified the "death" 128cdf0e10cSrcweir of the related content! 129cdf0e10cSrcweir 130cdf0e10cSrcweir <p>This action must be notified at the listeners of the deleted 131cdf0e10cSrcweir content. 132cdf0e10cSrcweir */ 133cdf0e10cSrcweir const long DELETED = 2; 134cdf0e10cSrcweir 135cdf0e10cSrcweir //------------------------------------------------------------------------- 136cdf0e10cSrcweir /** This Action indicates that a content has changed its identity (i.e. 137cdf0e10cSrcweir after renaming a file system folder). 138cdf0e10cSrcweir 139cdf0e10cSrcweir <p>This action must be notified at the listeners of the exchanged 140cdf0e10cSrcweir content. 141cdf0e10cSrcweir */ 142cdf0e10cSrcweir const long EXCHANGED = 4; 143cdf0e10cSrcweir 144cdf0e10cSrcweir //------------------------------------------------------------------------- 145cdf0e10cSrcweir /** This is obsolete and should no longer be used. 146cdf0e10cSrcweir 147cdf0e10cSrcweir @deprecated 148cdf0e10cSrcweir */ 149cdf0e10cSrcweir const long SEARCH_MATCHED = 128; 150cdf0e10cSrcweir 151cdf0e10cSrcweir}; 152cdf0e10cSrcweir 153cdf0e10cSrcweir//============================================================================= 154cdf0e10cSrcweir 155cdf0e10cSrcweir}; }; }; }; 156cdf0e10cSrcweir 157cdf0e10cSrcweir#endif 158