Back to index

d-push  2.0
syncbasebody.php
Go to the documentation of this file.
00001 <?php
00002 /***********************************************
00003 * File      :   syncbasebody.php
00004 * Project   :   Z-Push
00005 * Descr     :   WBXML AirSyncBase body entities that can be parsed
00006 *               directly (as a stream) from WBXML.
00007 *               It is automatically decoded according to $mapping,
00008 *               and the Sync WBXML mappings.
00009 *
00010 * Created   :   09.09.2011
00011 *
00012 * Copyright 2007 - 2011 Zarafa Deutschland GmbH
00013 *
00014 * This program is free software: you can redistribute it and/or modify
00015 * it under the terms of the GNU Affero General Public License, version 3,
00016 * as published by the Free Software Foundation with the following additional
00017 * term according to sec. 7:
00018 *
00019 * According to sec. 7 of the GNU Affero General Public License, version 3,
00020 * the terms of the AGPL are supplemented with the following terms:
00021 *
00022 * "Zarafa" is a registered trademark of Zarafa B.V.
00023 * "Z-Push" is a registered trademark of Zarafa Deutschland GmbH
00024 * The licensing of the Program under the AGPL does not imply a trademark license.
00025 * Therefore any rights, title and interest in our trademarks remain entirely with us.
00026 *
00027 * However, if you propagate an unmodified version of the Program you are
00028 * allowed to use the term "Z-Push" to indicate that you distribute the Program.
00029 * Furthermore you may use our trademarks where it is necessary to indicate
00030 * the intended purpose of a product or service provided you use it in accordance
00031 * with honest practices in industrial or commercial matters.
00032 * If you want to propagate modified versions of the Program under the name "Z-Push",
00033 * you may only do so if you have a written permission by Zarafa Deutschland GmbH
00034 * (to acquire a permission please contact Zarafa at trademark@zarafa.com).
00035 *
00036 * This program is distributed in the hope that it will be useful,
00037 * but WITHOUT ANY WARRANTY; without even the implied warranty of
00038 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00039 * GNU Affero General Public License for more details.
00040 *
00041 * You should have received a copy of the GNU Affero General Public License
00042 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00043 *
00044 * Consult LICENSE file for details
00045 ************************************************/
00046 
00047 class SyncBaseBody extends SyncObject {
00048     public $type; //Possible types are plain text, html, rtf and mime
00049     public $estimatedDataSize;
00050     public $truncated;
00051     public $data;
00052     public $preview;
00053 
00054     function SyncBaseBody() {
00055         $mapping = array(
00056                     SYNC_AIRSYNCBASE_TYPE                               => array (self::STREAMER_VAR        => "type"),
00057                     SYNC_AIRSYNCBASE_ESTIMATEDDATASIZE                  => array (self::STREAMER_VAR        => "estimatedDataSize"),
00058                     SYNC_AIRSYNCBASE_TRUNCATED                          => array (self::STREAMER_VAR        => "truncated"),
00059                     SYNC_AIRSYNCBASE_DATA                               => array (self::STREAMER_VAR        => "data"), //TODO data should be of a type stream
00060         );
00061         if(Request::GetProtocolVersion() >= 14.0) {
00062             $mapping[SYNC_AIRSYNCBASE_PREVIEW]                          =  array (self::STREAMER_VAR        => "preview");
00063         }
00064 
00065         parent::SyncObject($mapping);
00066     }
00067 }
00068 ?>