[operations] [attributes] [fields] [template] [definition]
[implementation] [documentation]
To use the search tool you need to use a browser which supports JAVA (c)

[next] [prev] [superclass] [next peer] [prev peer] [subclass] [index] [hierarchy]

Message

inherits from ObjectList
inherits from HasServiceChoice

Object <- FixedList <- ObjectList <- Message



Operations

Get list of all operations

DateReceived
DateSent
EachDeliveryChoice
FirstBadRecipient
HandleBadContent
HasCorrespondent
HasRecipients
IsReadyToSend
MailList
MakeValid
MapIndexToList
MapListToIndex
ResolveAddressing
SetDateReceived
SetDateSent
SetSenderWithAddress


Attributes

Get list of all attributes

BlindCopyRecipients
CopyRecipients
DeliveryChoice
DeliveryChoiceIndex
DeliveryChoices
DispatchTime
From
Means
ReplyTo
SelectedRecipient
Sender
ServiceChoice
ServiceChoice
ToRecipients


Fields

Field Type
Message: dispatchTime: Time
sender: SimpleContact
dateReceived: Signed
timeReceived: Unsigned
deliveryChoices: ObjectList
deliveryChoiceIndex: Unsigned


Instance template

instance Message tag;
   dispatchTime: nilObject;
         sender: nilObject;
   dateReceived: 0;
   timeReceived: 0;
deliveryChoices: nilObject;
deliveryChoiceIndex: 0;
end instance;

Class definition

Define Class Message;
    inherits from ObjectList;
    inherits from HasServiceChoice;

    field dispatchTime      : Time, getter, setter;
    field sender            : SimpleContact, getter;

    // Here are our local-only fields
    // Maybe these should go in PersonalMessage?
    field dateReceived      : Signed;
    field timeReceived      : Unsigned;
    field deliveryChoices   : ObjectList, getter, setter;
    field deliveryChoiceIndex : Unsigned, setter;

    attribute Sender: SimpleContact, readOnly;
        // returns the simple contact for the sender of the message
        // it's readOnly because the setter needs to do a bit of work and needs a parameter
    operation SetSenderWithAddress(sender: FullContact; includeAddress: Boolean);
        // called by routines that set up telecards
        // takes a full contact <sender> but stores a simple contact
        // if <includeAddress> is true, include an email address in the simple contact

    operation DateReceived(var millisecs: Unsigned): Signed;
    operation HasCorrespondent(correspondent: FullContact): Boolean;    
    operation HasRecipients(): Boolean , noFail;
    operation ResolveAddressing();
    operation SetDateReceived(newDate: Signed; newTime: Unsigned);

    operation DateSent(var millisecs: Unsigned): Signed;
    operation SetDateSent(newDate: Signed; newTime: Unsigned);

    operation IsReadyToSend(handleNotReady: Boolean): Boolean;
        // return true iff this card is fully filled out and ready to be sent
        // if handleNotReady is true and the card isn't ready, do something about it
        // such as explaining why or helping the user fill in the missing bits

    attribute DispatchTime: Time;

    // interface to DeliveryChoices
    attribute Means: Means;
    attribute DeliveryChoice: Object;
    attribute DeliveryChoices: ObjectList;
    attribute DeliveryChoiceIndex: Unsigned;
    operation EachDeliveryChoice(function: EachFunction; parameters: Pointer): Object, noFail;

    overrides ServiceChoice, SetServiceChoice;

    // for compatibility with personal message in many viewers, must have these stubs
    attribute ToRecipients: ObjectList, readOnly;           
        // return nilObject
    attribute From: ObjectList, readOnly;                   
        // return nilObject
    attribute ReplyTo: ObjectList, readOnly;                
        // return nilObject
    attribute CopyRecipients: ObjectList, readOnly;         
        // return nilObject
    attribute BlindCopyRecipients: ObjectList, readOnly;    
        // return nilObject

    operation MapListToIndex(whichList: Unsigned; offset: Unsigned): Unsigned;
    operation MapIndexToList(index: Unsigned; var offset: Unsigned): ObjectList;
    operation MailList(whichList: Unsigned): ObjectList;
    attribute SelectedRecipient: SimpleContact, readOnly, safe;
        // returns the simple contact who is the currently selected recipient (with the
        // bullet beside their name if there are several recipients)

    overrides HandleBadContent;
        // if message has originator and some content return true; otherwise return false
        // if returning true, add stamp to let user know part is misssing
    operation FirstBadRecipient(var reason: Unsigned): Object;
        // Returns the first recipient of the message that has a problem
        // The reason parameter specifies what kind of problem was found : kEmptyGroup, kNoDeliveryChoice 

    overrides MakeValid;
        // Make sure the sender field holds a simple contact, not a full contact.
end class;