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