⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xsms.int

📁 boomerang library 5.11 internet ed
💻 INT
字号:
unit XSMS;


{ Listing generated by Opus Documentor 1.2.1.1147 on 2.1.2007 }
{ Parts omitted from listing: protected, private, undocumented }


{==============================================================================}
interface
uses
  Classes, SysUtils, Windows, Graphics, GSM, Contnrs, Connect;

const 
  smCommonTelChar = [ '-', '#', '*', 'W', 'w', 'P', 'p', smSpace ] + smCommonDigit;
  smBlinkOn = TChar( 'y' );
  smBlinkOff = TChar( 'o' );

type 

  TSMSProtocolStatus = 
    ( smspsEmpty
    , smspsOK
    , smspsNotComplete
    );

  TSMSProtocolInsertStatus = 
    ( smsprOK
    , smsprBadFragment
    , smsprFragmentDoesNotFit
    , smsprFragmentDifferentData
    );

  TSMSProtocolOptions = 
    ( smspoAddressing
    , smspoReference
    );

  TSMSProtocol = class
  public
    procedure Clear; virtual;
  public
    property FragmentCount: Integer read;
    property InsertedCount: Integer read;
    property Fragments[ Index: Integer ]: TString read;
    property Status: TSMSProtocolStatus read;
    property Stamp: TDateTime read;
  public
    function InsertFragment( const aFragment: TString ): TSMSProtocolInsertStatus; virtual; abstract;
  published
    property Data: TString read write;
    property Reference: LongInt read write;
  end {TSMSProtocol};

  TSMSProtocol2 = class( TSMSProtocol )
  published
    property SourceAddress: Word read write;
    property DestinationAddress: Word read write;
    property Options: TSMSProtocolOptionsSet read write;
  end {TSMSProtocol2};

  TNBS = class( TSMSProtocol2 )
  published
    property OtherHeader: TString read write;
    property Binary: Boolean read write;
  end {TNBS};

  TIE = class
  public
    property IEI: Byte read write;
    property IED: TString read write;
  end {TIE};

  TUDHProtocol = class( TSMSProtocol2 )
  public
    property IEs: TObjectList read;
  end {TUDHProtocol};

  TEMSUDHProtocol = class( TUDHProtocol )
  end {TEMSUDHProtocol};

  TSiemensOTA = class( TSMSProtocol )
  published
    property ObjectName: TString read write;
    property ObjectType: TString read write;
  end {TSiemensOTA};

  TSMSProtocolStack = class( TStringList )
  public
    function ProcessSMS( 
        aSMS: TSMS; 
        var aId: TSMSProtocol ): Boolean;
    procedure RemoveSMSProtocol( aId: TSMSProtocol );
    procedure CleanSMSProtocols( 
        aRelativeDT: TDateTime; 
        aOnlyNotComplete: Boolean );
  end {TSMSProtocolStack};

  TDirectoryRecordHeader = 
    ( drhFull
    , drhPartial
    , drhNone
    );

  TDirectoryRecords = class( TStringList )
  published
    property FoldingLength: Integer read write;
    property Data: TString read write;
    property Kind: string read write;
  public
    property Params[ Index: Integer ]: TStrings read;
    property ParamsOf[ aName: string ]: TStrings read;
  end {TDirectoryRecords};

  TSoundMelodyPatternScale = 
    ( smps55Hz
    , smps110Hz
    , smps220Hz
    , smps440Hz
    , smps880Hz
    , smps1760Hz
    , smps3520Hz
    , smps7040Hz
    , smps14080Hz
    );

  TSoundMelodyPatternNote = 
    ( smgpnPause
    , smgpnC
    , smgpnCis
    , smgpnDes
    , smgpnD
    , smgpnDis
    , ssmgpnEs
    , mginE
    , smgpnEis
    , smgpnF
    , smgpnFis
    , smgpnGes
    , smgpnG
    , smgpnGis
    , smgpnAs
    , smgpnA
    , smgpnAis
    , smgpnB
    , smgpnH
    , smgpnHis
    );

  TSoundMelodyPatternDuration = 
    ( smgpdFull
    , smgpd2
    , smgpd4
    , smgpd8
    , smgpd16
    , smgpd32
    );

  TSoundMelodyPatternDurationSpecifier = 
    ( smgpdsNoSpecial
    , smgpdsDotted
    , smgpdsDoubleDotted
    , smgpdsLength2_3
    );

  TSoundMelodyPatternStyle = 
    ( smpsNatural
    , smpsContinuous
    , smpsStaccato
    );

  TSoundMelodyPatternItem = record
    Scale: TSoundMelodyPatternScale;
    Note: TSoundMelodyPatternNote;
    Duration: TSoundMelodyPatternDuration;
    DurationSpecifier: TSoundMelodyPatternDurationSpecifier;
    Tempo: Byte;
    Style: TSoundMelodyPatternStyle;
    Volume: Byte;
    Special: Integer;
  end {TSoundMelodyPatternItem};

  TSoundMelody = class
  public
    Name: TString;
    Pattern: array of TSoundMelodyPatternItem;
  public
    property RTTTL: TString read write;
  public
    constructor Create;
    class function DecodeBeatsPerMin( aBeats: Byte ): Word;
    class function EncodeBeatsPerMin( aBeats: Word ): Byte;
    procedure InitPattern;
    function CreateStrings{}: TStrings;
    procedure AssignStrings( Sg: TStrings );
  end {TSoundMelody};

  TSmartMessage = class
  public
    class function CreateSM( 
        const aData: TString; 
        aPort: Word ): TSmartMessage;
  public
    property Data: TString read write;
  end {TSmartMessage};

  TSMMIMEDirectory = class( TSmartMessage )
  public
    property Records: TDirectoryRecords read;
  end {TSMMIMEDirectory};

  TSMvCard = class( TSMMIMEDirectory )
  end {TSMvCard};

  TSMvCalendar = class( TSMMIMEDirectory )
  end {TSMvCalendar};

  TSMOTABitmap = class( TSmartMessage )
  public
    property InfoFieldCount: Byte read write;
    property InfoFields[ Index: Integer ]: Byte read write;
    property AnimatedImageCount: Integer read write;
    property Width: Integer read write;
    property Height: Integer read write;
    property Images[ Index: Integer ]: TBitmap read write;
  public
    procedure ImportFromImage( aBMP: TBitmap );
    procedure ExportToImage( aBMP: TBitmap );
  end {TSMOTABitmap};

  TSMScreenSaver = class( TSMOTABitmap )
  end {TSMScreenSaver};

  TSMCLIIcon = class( TSMOTABitmap )
  end {TSMCLIIcon};

  TSMOperatorLogo = class( TSMOTABitmap )
  public
    property MCC: Word read write;
    property MNC: Byte read write;
  end {TSMOperatorLogo};

  TSMTextISO = class( TSmartMessage )
  public
    property Text: TString read write;
  end {TSMTextISO};

  TSMTextUnicode = class( TSmartMessage )
  public
    property Text: WideString read write;
  end {TSMTextUnicode};

  TSMProfile = class( TSMTextUnicode )
  end {TSMProfile};

  TBitStream = class
  public
    property Data: TString read write;
    property EOF: Boolean read;
  public
    procedure PutFillers;
    procedure SkipFillers;
    function GetBit{}: Boolean;
    procedure PutBit( aVal: Boolean );
    function GetBits( aNum: Byte ): LongWord;
    procedure PutBits( 
        aVal: LongWord; 
        aNum: Byte );
    procedure Move( aShift: Integer );
  end {TBitStream};

  TSMRTPattern = class
  public
    Id: Byte;
    Loop: Byte;
  public
    property Instructions: TObjectList read;
  end {TSMRTPattern};

  TSMRTInstruction = class
  public
    class function CreateFromStream( BS: TBitStream ): TSMRTInstruction;
  end {TSMRTInstruction};

  TSMRTNote = class( TSMRTInstruction )
  public
    Value: Byte;
    Duration: Byte;
    DurationSpecifier: Byte;
  end {TSMRTNote};

  TSMRTScale = class( TSMRTInstruction )
  public
    NoteScale: Byte;
  end {TSMRTScale};

  TSMRTStyle = class( TSMRTInstruction )
  public
    Value: Byte;
  end {TSMRTStyle};

  TSMRTTempo = class( TSMRTInstruction )
  public
    BeatsPerMin: Byte;
  end {TSMRTTempo};

  TSMRTVolume = class( TSMRTInstruction )
  public
    Value: Byte;
  end {TSMRTVolume};

  TSMRTCommandPart = class
  public
    class function CreateFromStream( BS: TBitStream ): TSMRTCommandPart;
  end {TSMRTCommandPart};

  TSMRTRingingTone = class( TSMRTCommandPart )
  end {TSMRTRingingTone};

  TSMRTUnicode = class( TSMRTCommandPart )
  end {TSMRTUnicode};

  TSMRTCancel = class( TSMRTCommandPart )
  end {TSMRTCancel};

  TSMRTSound = class( TSMRTCommandPart )
  public
    class function CreateFromStream( BS: TBitStream ): TSMRTCommandPart;
  end {TSMRTSound};

  TSMRTTemporarySong = class( TSMRTSound )
  public
    property Patterns: TObjectList read;
  end {TSMRTTemporarySong};

  TSMRTMidiSong = class( TSMRTSound )
  end {TSMRTMidiSong};

  TSMRTDigitisedSong = class( TSMRTSound )
  end {TSMRTDigitisedSong};

  TSMRTPolyphonicSong = class( TSMRTSound )
  end {TSMRTPolyphonicSong};

  TSMRTCommand = class
  public
    property Parts: TObjectList read;
  end {TSMRTCommand};

  TSMRingingTone = class( TSmartMessage )
  public
    property Commands: TObjectList read;
  public
    function CreateSoundMelody{}: TSoundMelody;
    procedure AssignSoundMelody( Value: TSoundMelody );
  end {TSMRingingTone};

  TSMMultipartMessage = class( TSmartMessage )
  public
    property Multiparts: TObjectList read;
  end {TSMMultipartMessage};

  TSMUnknown = class( TSmartMessage )
  end {TSMUnknown};

  TEMS = class
  public
    property Text: TString read write;
    property Objects: TObjectList read;
  public
    procedure ReadFrom( aProtocol: TUDHProtocol );
    procedure WriteTo( aProtocol: TUDHProtocol );
  end {TEMS};

  TEMSObject = class
  public
    property IEI: Byte read;
    property IED: TString read write;
  public
    class function CreateFromIEI( aIEI: Byte ): TEMSObject;
  end {TEMSObject};

  TEMSPosObject = class( TEMSObject )
  published
    property Pos: Byte read write;
  end {TEMSPosObject};

  TEMSUnknown = class( TEMSObject )
  published
    property Data: TString read write;
  end {TEMSUnknown};

  TEMSTextFormat = class( TEMSPosObject )
  published
    property Len: Byte read write;
    property Alignment: Byte read write;
    property Size: Byte read write;
    property Bold: Boolean read write;
    property Italic: Boolean read write;
    property Underlined: Boolean read write;
    property StrikeThrough: Boolean read write;
    property ForegroundColor: Byte read write;
    property BackgroundColor: Byte read write;
  end {TEMSTextFormat};

  TEMSSoundPredef = class( TEMSPosObject )
  published
    property SoundId: Byte read write;
  end {TEMSSoundPredef};

  TEMSSoundUserDef = class( TEMSPosObject )
  published
    property Records: TDirectoryRecords read;
  public
    function CreateSoundMelody{}: TSoundMelody;
    procedure AssignSoundMelody( 
        Value: TSoundMelody; 
        X: Integer = 0; 
        Len: Integer = MaxInt );
  end {TEMSSoundUserDef};

  TEMSAnimationPredef = class( TEMSPosObject )
  published
    property AnimationId: Byte read write;
  end {TEMSAnimationPredef};

  TEMSPicture = class( TEMSPosObject )
  published
    property Width: Integer read write;
    property Height: Integer read write;
  public
    procedure ImportFromImage( aBMP: TBitmap );
  end {TEMSPicture};

  TEMSPictureVariable = class( TEMSPicture )
  end {TEMSPictureVariable};

  TEMSPictureSmall = class( TEMSPicture )
  end {TEMSPictureSmall};

  TEMSPictureLarge = class( TEMSPicture )
  end {TEMSPictureLarge};

  TEMSAnimation = class( TEMSPosObject )
  published
    property Width: Integer read write;
    property Height: Integer read write;
  public
    property Images[ Index: Integer ]: TBitmap read write;
  public
    procedure ImportFromImage( aBMP: TBitmap );
    procedure ExportToImage( aBMP: TBitmap );
  end {TEMSAnimation};

  TEMSAnimationSmall = class( TEMSAnimation )
  end {TEMSAnimationSmall};

  TEMSAnimationLarge = class( TEMSAnimation )
  end {TEMSAnimationLarge};

  TEMSUserPrompt = class( TEMSObject )
  public
    property NumOfObjects: Byte read write;
  end {TEMSUserPrompt};

const 
  emsodiaNoForwarding = '01';

type 

  TEMSObjectDistributionIndicator = class( TEMSObject )
  public
    property NumOfIE: Byte read write;
    property Attrib: Byte read write;
  end {TEMSObjectDistributionIndicator};

const 
  emsxaNoForwarding = '01';
  emsxaUserPrompt = '02';

type 

  TEMSXObject = class( TEMSObject )
  published
    property HeaderFlag: Boolean read write;
    property Reference: Byte read write;
    property Pos: Word read write;
    property Attrib: Byte read write;
    property DataLength: Word read write;
    property Kind: Byte read write;
    property Data: TString read write;
  end {TEMSXObject};

  TEMSXObjectReused = class( TEMSObject )
  published
    property Reference: Byte read write;
    property Pos: Word read write;
  end {TEMSXObjectReused};

  TEMSXObjectDataRequest = class( TEMSObject )
  end {TEMSXObjectDataRequest};

  TEMSWVGObject = class( TEMSPosObject )
  published
    property Data: TString read write;
  end {TEMSWVGObject};

  TEMSWVGObjectStandard = class( TEMSWVGObject )
  end {TEMSWVGObjectStandard};

  TEMSWVGObjectCharSize = class( TEMSWVGObject )
  end {TEMSWVGObjectCharSize};

  TEMSCompressionControl = class( TEMSUnknown )
  end {TEMSCompressionControl};

const 
  SoundMelodyPatternNoteEnum: array[ TSoundMelodyPatternNote ] of string= 
    ( 'pause'
    , 'c'
    , 'cis'
    , 'des'
    , 'd'
    , 'dis'
    , 'es'
    , 'e'
    , 'eis'
    , 'f'
    , 'fis'
    , 'ges'
    , 'g'
    , 'gis'
    , 'as'
    , 'a'
    , 'ais'
    , 'b'
    , 'h'
    , 'his'
    );
  SoundMelodyPatternDurationEnum: array[ TSoundMelodyPatternDuration ] of string= 
    ( 'Full'
    , '1/2'
    , '1/4'
    , '1/8'
    , '1/16'
    , '1/32'
    );
  SoundMelodyPatternDurationSpecifierEnum: array[ TSoundMelodyPatternDurationSpecifier ] of string= 
    ( 'no special'
    , 'dotted'
    , 'double dotted'
    , '2/3 length'
    );
  SoundMelodyPatternStyleEnum: array[ TSoundMelodyPatternStyle ] of string= 
    ( 'natural'
    , 'continuous'
    , 'staccato'
    );
  SoundMelodyPatternTempoEnum: array[ 0 .. 31 ] of Word= 
    ( 25
    , 28
    , 31
    , 35
    , 40
    , 45
    , 50
    , 56
    , 63
    , 70
    , 80
    , 90
    , 100
    , 112
    , 125
    , 140
    , 160
    , 180
    , 200
    , 225
    , 250
    , 285
    , 320
    , 355
    , 400
    , 450
    , 500
    , 565
    , 635
    , 715
    , 800
    , 900
    );


{==============================================================================}
implementation

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -