api.js 241 KB
Newer Older
Alexander.Trofimov's avatar
Alexander.Trofimov committed
1 2
"use strict";

3 4
(function(window, document){

5
// Import
6 7 8 9 10 11 12
var DownloadType = AscCommon.DownloadType;
var locktype_None = AscCommon.locktype_None;
var locktype_Mine = AscCommon.locktype_Mine;
var locktype_Other = AscCommon.locktype_Other;
var locktype_Other2 = AscCommon.locktype_Other2;
var locktype_Other3 = AscCommon.locktype_Other3;
var changestype_Drawing_Props = AscCommon.changestype_Drawing_Props;
13
var asc_CSelectedObject = AscCommon.asc_CSelectedObject;
14 15 16 17 18
var g_oDocumentUrls = AscCommon.g_oDocumentUrls;
var sendCommand = AscCommon.sendCommand;
var mapAscServerErrorToAscError = AscCommon.mapAscServerErrorToAscError;
var g_oIdCounter = AscCommon.g_oIdCounter;
var g_oTableId = AscCommon.g_oTableId;
19 20 21
var PasteElementsId = null;
var global_mouseEvent = null;
var History = null;
22

23
var c_oAscError = Asc.c_oAscError;
24 25 26 27 28
var c_oAscFileType = Asc.c_oAscFileType;
var c_oAscAsyncAction = Asc.c_oAscAsyncAction;
var c_oAscAsyncActionType = Asc.c_oAscAsyncActionType;
var c_oAscTypeSelectElement = Asc.c_oAscTypeSelectElement;
var c_oAscFill = Asc.c_oAscFill;
29 30
var asc_CShapeFill = Asc.asc_CShapeFill;
var asc_CFillBlip = Asc.asc_CFillBlip;
31

32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223
function CAscSlideProps()
{
  this.Background = null;
  this.Timing = null;
  this.lockDelete = null;
  this.lockLayout = null;
  this.lockTiming = null;
  this.lockBackground = null;
  this.lockTranzition = null;
  this.lockRemove = null;
}

CAscSlideProps.prototype.get_background = function(){return this.Background;};
CAscSlideProps.prototype.put_background = function(v){this.Background = v;};
CAscSlideProps.prototype.get_timing = function(){return this.Timing;};
CAscSlideProps.prototype.put_timing = function(v){this.Timing = v;};
CAscSlideProps.prototype.get_LockDelete = function(){return this.lockDelete;};
CAscSlideProps.prototype.put_LockDelete = function(v){this.lockDelete = v;};
CAscSlideProps.prototype.get_LockLayout = function(){return this.lockLayout;};
CAscSlideProps.prototype.put_LockLayout = function(v){this.lockLayout = v;};
CAscSlideProps.prototype.get_LockTiming = function(){return this.lockTiming;};
CAscSlideProps.prototype.put_LockTiming = function(v){this.lockTiming = v;};
CAscSlideProps.prototype.get_LockBackground = function(){return this.lockBackground;};
CAscSlideProps.prototype.put_LockBackground = function(v){this.lockBackground = v;};
CAscSlideProps.prototype.get_LockTranzition = function(){return this.lockTranzition;};
CAscSlideProps.prototype.put_LockTranzition = function(v){this.lockTranzition = v;};
CAscSlideProps.prototype.get_LockRemove = function(){return this.lockRemove;};
CAscSlideProps.prototype.put_LockRemove = function(v){this.lockRemove = v;};

function CAscChartProp( obj )
{
  if( obj )
  {

    this.Width         = (undefined != obj.w) ? obj.w : undefined;
    this.Height        = (undefined != obj.h) ? obj.h : undefined;
    this.Position      = new Asc.CPosition({X: obj.x, Y: obj.y});

    this.Locked        = (undefined != obj.locked) ? obj.locked : false;

    this.ChartProperties = (undefined != obj.chartProps) ? obj.chartProps : null;

    this.severalCharts = obj.severalCharts != undefined ? obj.severalCharts : false;
    this.severalChartTypes = obj.severalChartTypes != undefined ? obj.severalChartTypes : undefined;
    this.severalChartStyles = obj.severalChartStyles != undefined ? obj.severalChartStyles : undefined;
  }
  else
  {
    this.Width         = undefined;
    this.Height        = undefined;
    this.Position      = undefined;
    this.Locked   = false;

    this.ChartProperties = new AscCommon.asc_ChartSettings();

    this.severalCharts = false;
    this.severalChartTypes = undefined;
    this.severalChartStyles = undefined;
  }
}
CAscChartProp.prototype.get_ChangeLevel = function() { return this.ChangeLevel; };
CAscChartProp.prototype.put_ChangeLevel = function(v) { this.ChangeLevel = v; };

CAscChartProp.prototype.get_CanBeFlow = function() { return this.CanBeFlow; };
CAscChartProp.prototype.get_Width = function() { return this.Width; };
CAscChartProp.prototype.put_Width = function(v) { this.Width = v; };
CAscChartProp.prototype.get_Height = function() { return this.Height; };
CAscChartProp.prototype.put_Height = function(v) { this.Height = v; };
CAscChartProp.prototype.get_WrappingStyle = function() { return this.WrappingStyle; };
CAscChartProp.prototype.put_WrappingStyle = function(v) { this.WrappingStyle = v; };
// Возвращается объект класса Asc.asc_CPaddings
CAscChartProp.prototype.get_Paddings = function() { return this.Paddings; };
// Аргумент объект класса Asc.asc_CPaddings
CAscChartProp.prototype.put_Paddings = function(v) { this.Paddings = v; };
CAscChartProp.prototype.get_AllowOverlap = function() {return this.AllowOverlap;};
CAscChartProp.prototype.put_AllowOverlap = function(v) {this.AllowOverlap = v;};
// Возвращается объект класса CPosition
CAscChartProp.prototype.get_Position = function() { return this.Position; };
// Аргумент объект класса CPosition
CAscChartProp.prototype.put_Position = function(v) { this.Position = v; };
CAscChartProp.prototype.get_PositionH = function()  { return this.PositionH; };
CAscChartProp.prototype.put_PositionH = function(v) { this.PositionH = v; };
CAscChartProp.prototype.get_PositionV = function()  { return this.PositionV; };
CAscChartProp.prototype.put_PositionV = function(v) { this.PositionV = v; };
CAscChartProp.prototype.get_Value_X = function(RelativeFrom) { if ( null != this.Internal_Position ) return this.Internal_Position.Calculate_X_Value(RelativeFrom);  return 0; };
CAscChartProp.prototype.get_Value_Y = function(RelativeFrom) { if ( null != this.Internal_Position ) return this.Internal_Position.Calculate_Y_Value(RelativeFrom);  return 0; };

CAscChartProp.prototype.get_ImageUrl = function() { return this.ImageUrl; };
CAscChartProp.prototype.put_ImageUrl = function(v) { this.ImageUrl = v; };
CAscChartProp.prototype.get_Group = function() { return this.Group; };
CAscChartProp.prototype.put_Group = function(v) { this.Group = v; };
CAscChartProp.prototype.asc_getFromGroup = function() { return this.fromGroup; };
CAscChartProp.prototype.asc_putFromGroup = function(v) { this.fromGroup = v; };

CAscChartProp.prototype.get_isChartProps = function() { return this.isChartProps; };
CAscChartProp.prototype.put_isChartPross = function(v) { this.isChartProps = v; };

CAscChartProp.prototype.get_SeveralCharts = function() { return this.severalCharts; };
CAscChartProp.prototype.put_SeveralCharts = function(v) { this.severalCharts = v; };
CAscChartProp.prototype.get_SeveralChartTypes = function() { return this.severalChartTypes; };
CAscChartProp.prototype.put_SeveralChartTypes = function(v) { this.severalChartTypes = v; };

CAscChartProp.prototype.get_SeveralChartStyles = function() { return this.severalChartStyles; };
CAscChartProp.prototype.put_SeveralChartStyles = function(v) { this.severalChartStyles = v; };

CAscChartProp.prototype.get_VerticalTextAlign = function() { return this.verticalTextAlign; };
CAscChartProp.prototype.put_VerticalTextAlign = function(v) { this.verticalTextAlign = v; };

CAscChartProp.prototype.get_Locked = function() { return this.Locked; };

CAscChartProp.prototype.get_ChartProperties = function()
{
  return this.ChartProperties;
};

CAscChartProp.prototype.put_ChartProperties = function(v)
{
  this.ChartProperties = v;
};

CAscChartProp.prototype.get_ShapeProperties = function()
{
  return this.ShapeProperties;
};

CAscChartProp.prototype.put_ShapeProperties = function(v)
{
  this.ShapeProperties = v;
};

CAscChartProp.prototype.asc_getType = function()
{
  return this.ChartProperties.asc_getType();
};
CAscChartProp.prototype.asc_getSubType = function()
{
  return this.ChartProperties.asc_getSubType();
};

CAscChartProp.prototype.asc_getStyleId = function()
{
  return this.ChartProperties.asc_getStyleId();
};

CAscChartProp.prototype.asc_getHeight = function()
{
  return this.Height;
};
CAscChartProp.prototype.asc_getWidth = function()
{
  return this.Width;
};

CAscChartProp.prototype.asc_setType = function(v)
{
  this.ChartProperties.asc_setType(v);
};
CAscChartProp.prototype.asc_setSubType = function(v)
{
  this.ChartProperties.asc_setSubType(v);
};

CAscChartProp.prototype.asc_setStyleId = function(v)
{
  this.ChartProperties.asc_setStyleId(v);
};

CAscChartProp.prototype.asc_setHeight = function(v)
{
  this.Height = v;
};
CAscChartProp.prototype.asc_setWidth = function(v)
{
  this.Width = v;
};

CAscChartProp.prototype.getType = function()
{
  return this.ChartProperties && this.ChartProperties.getType();
};
CAscChartProp.prototype.putType = function(v)
{
  return this.ChartProperties && this.ChartProperties.putType(v);
};

CAscChartProp.prototype.getStyle = function()
{
  return this.ChartProperties && this.ChartProperties.getStyle();
};
CAscChartProp.prototype.putStyle = function(v)
{
  return this.ChartProperties && this.ChartProperties.putStyle(v);
224
};
225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394

CAscChartProp.prototype.changeType = function(v)
{
  return this.ChartProperties && this.ChartProperties.changeType(v);
};

function CDocInfoProp(obj)
{
  if(obj){
    this.PageCount = obj.PageCount;
    this.WordsCount = obj.WordsCount;
    this.ParagraphCount = obj.ParagraphCount;
    this.SymbolsCount = obj.SymbolsCount;
    this.SymbolsWSCount = obj.SymbolsWSCount;
  }
  else {
    this.PageCount = -1;
    this.WordsCount = -1;
    this.ParagraphCount = -1;
    this.SymbolsCount = -1;
    this.SymbolsWSCount = -1;
  }
}
CDocInfoProp.prototype.get_PageCount = function(){ return this.PageCount; };
CDocInfoProp.prototype.put_PageCount = function(v){ this.PageCount = v; };
CDocInfoProp.prototype.get_WordsCount = function(){ return this.WordsCount; };
CDocInfoProp.prototype.put_WordsCount = function(v){ this.WordsCount = v; };
CDocInfoProp.prototype.get_ParagraphCount = function(){ return this.ParagraphCount; };
CDocInfoProp.prototype.put_ParagraphCount = function(v){ this.ParagraphCount = v; };
CDocInfoProp.prototype.get_SymbolsCount = function(){ return this.SymbolsCount; };
CDocInfoProp.prototype.put_SymbolsCount = function(v){ this.SymbolsCount = v; };
CDocInfoProp.prototype.get_SymbolsWSCount = function(){ return this.SymbolsWSCount; };
CDocInfoProp.prototype.put_SymbolsWSCount = function(v){ this.SymbolsWSCount = v; };

/*----------------------------------------------------------------*/
/*functions for working with headers*/
/*
 структура заголовков, предварительно, выглядит так
 {
 headerText: "Header1",//заголовок
 pageNumber: 0, //содержит номер страницы, где находится искомая последовательность
 X: 0,//координаты по OX начала последовательности на данной страницы
 Y: 0,//координаты по OY начала последовательности на данной страницы
 level: 0//уровень заголовка
 }
 заголовки приходят либо в списке, либо последовательно.
 */
// CHeader
function CHeader (obj)
{
  if (obj)
  {
    this.headerText = (undefined != obj.headerText) ? obj.headerText : null;	//заголовок
    this.pageNumber = (undefined != obj.pageNumber) ? obj.pageNumber : null;	//содержит номер страницы, где находится искомая последовательность
    this.X = (undefined != obj.X) ? obj.X : null;								//координаты по OX начала последовательности на данной страницы
    this.Y = (undefined != obj.Y) ? obj.Y : null;								//координаты по OY начала последовательности на данной страницы
    this.level = (undefined != obj.level) ? obj.level : null;					//позиция заголовка
  }
  else
  {
    this.headerText = null;				//заголовок
    this.pageNumber = null;				//содержит номер страницы, где находится искомая последовательность
    this.X = null;						//координаты по OX начала последовательности на данной страницы
    this.Y = null;						//координаты по OY начала последовательности на данной страницы
    this.level = null;					//позиция заголовка
  }
}
CHeader.prototype.get_headerText = function ()
{
  return this.headerText;
};
CHeader.prototype.get_pageNumber = function ()
{
  return this.pageNumber;
};
CHeader.prototype.get_X = function ()
{
  return this.X;
};
CHeader.prototype.get_Y = function ()
{
  return this.Y;
};
CHeader.prototype.get_Level = function ()
{
  return this.level;
};
var _fakeHeaders = [
  new CHeader ({headerText: "Header1", pageNumber: 0, X: 0, Y: 0, level: 1}),
  new CHeader ({headerText: "Header2", pageNumber: 0, X: 0, Y: 0, level: 1}),
  new CHeader ({headerText: "Header3", pageNumber: 0, X: 0, Y: 0, level: 2}),
  new CHeader ({headerText: "Header4", pageNumber: 0, X: 0, Y: 0, level: 1}),
  new CHeader ({headerText: "Header5", pageNumber: 0, X: 0, Y: 0, level: 1}),
  new CHeader ({headerText: "Header5", pageNumber: 0, X: 0, Y: 0, level: 1}),
  new CHeader ({headerText: "Header5", pageNumber: 0, X: 0, Y: 0, level: 2}),
  new CHeader ({headerText: "Header5", pageNumber: 0, X: 0, Y: 0, level: 3}),
  new CHeader ({headerText: "Header3", pageNumber: 0, X: 0, Y: 0, level: 4}),
  new CHeader ({headerText: "Header3", pageNumber: 0, X: 0, Y: 0, level: 5}),
  new CHeader ({headerText: "Header3", pageNumber: 0, X: 0, Y: 0, level: 6}),
  new CHeader ({headerText: "Header4", pageNumber: 0, X: 0, Y: 0, level: 7}),
  new CHeader ({headerText: "Header5", pageNumber: 0, X: 0, Y: 0, level: 8}),
  new CHeader ({headerText: "Header5", pageNumber: 0, X: 0, Y: 0, level: 1}),
  new CHeader ({headerText: "Header5", pageNumber: 0, X: 0, Y: 0, level: 1}),
  new CHeader ({headerText: "Header5", pageNumber: 0, X: 0, Y: 0, level: 2}),
  new CHeader ({headerText: "Header5", pageNumber: 0, X: 0, Y: 0, level: 3}),
  new CHeader ({headerText: "Header6", pageNumber: 0, X: 0, Y: 0, level: 1}),
  new CHeader ({headerText: "Header5", pageNumber: 0, X: 0, Y: 0, level: 0}),
  new CHeader ({headerText: "Header5", pageNumber: 0, X: 0, Y: 0, level: 1}),
  new CHeader ({headerText: "Header5", pageNumber: 0, X: 0, Y: 0, level: 0}),
  new CHeader ({headerText: "Header5", pageNumber: 0, X: 0, Y: 0, level: 0})
];

// CSearchResult - returns result of searching
function CSearchResult (obj)
{
  this.Object = obj;
}

CSearchResult.prototype.get_Text = function ()
{
  return this.Object.text;
};

CSearchResult.prototype.get_Navigator = function ()
{
  return this.Object.navigator;
};

CSearchResult.prototype.put_Navigator = function (obj)
{
  this.Object.navigator = obj;
};
CSearchResult.prototype.put_Text = function (obj)
{
  this.Object.text = obj;
};

function CTablePropLook(obj)
{
  this.FirstCol = false;
  this.FirstRow = false;
  this.LastCol  = false;
  this.LastRow  = false;
  this.BandHor  = false;
  this.BandVer  = false;

  if ( obj )
  {
    this.FirstCol = ( undefined === obj.m_bFirst_Col ? false : obj.m_bFirst_Col );
    this.FirstRow = ( undefined === obj.m_bFirst_Row ? false : obj.m_bFirst_Row );
    this.LastCol  = ( undefined === obj.m_bLast_Col  ? false : obj.m_bLast_Col );
    this.LastRow  = ( undefined === obj.m_bLast_Row  ? false : obj.m_bLast_Row );
    this.BandHor  = ( undefined === obj.m_bBand_Hor  ? false : obj.m_bBand_Hor );
    this.BandVer  = ( undefined === obj.m_bBand_Ver  ? false : obj.m_bBand_Ver );
  }
}

CTablePropLook.prototype.get_FirstCol = function() {return this.FirstCol;};
CTablePropLook.prototype.put_FirstCol = function(v) {this.FirstCol = v;};
CTablePropLook.prototype.get_FirstRow = function() {return this.FirstRow;};
CTablePropLook.prototype.put_FirstRow = function(v) {this.FirstRow = v;};
CTablePropLook.prototype.get_LastCol = function() {return this.LastCol;};
CTablePropLook.prototype.put_LastCol = function(v) {this.LastCol = v;};
CTablePropLook.prototype.get_LastRow = function() {return this.LastRow;};
CTablePropLook.prototype.put_LastRow = function(v) {this.LastRow = v;};
CTablePropLook.prototype.get_BandHor = function() {return this.BandHor;};
CTablePropLook.prototype.put_BandHor = function(v) {this.BandHor = v;};
CTablePropLook.prototype.get_BandVer = function() {return this.BandVer;};
CTablePropLook.prototype.put_BandVer = function(v) {this.BandVer = v;};

395 396 397 398
/**
 *
 * @param name
 * @constructor
399
 * @extends {AscCommon.baseEditorsApi}
400
 */
401 402
function asc_docs_api(name)
{
403
  asc_docs_api.superclass.constructor.call(this, name, AscCommon.c_oEditorId.Presentation);
404

405
	/************ private!!! **************/
406
    this.WordControl = null;
407

408 409
  this.documentFormatSave = c_oAscFileType.PPTX;

410 411 412 413 414 415
    this.ThemeLoader = null;
    this.tmpThemesPath = null;
    this.tmpIsFreeze = null;
    this.tmpSlideDiv = null;
    this.tmpTextArtDiv = null;
    this.tmpViewRulers = null;
Alexander.Trofimov's avatar
Alexander.Trofimov committed
416
    this.tmpZoomType = null;
417 418

    this.DocumentUrl = "";
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
419
    this.bNoSendComments = false;
Oleg.Korshul's avatar
Oleg.Korshul committed
420

Oleg.Korshul's avatar
Oleg.Korshul committed
421 422 423
    this.isApplyChangesOnOpen = false;
    this.isApplyChangesOnOpenEnabled = true;

Oleg.Korshul's avatar
Oleg.Korshul committed
424
    this.IsSupportEmptyPresentation = true;
425 426
        
    this.ShowParaMarks = false;
427
    this.ShowSnapLines = true;
428 429 430
	this.isAddSpaceBetweenPrg = false;
    this.isPageBreakBefore = false;
    this.isKeepLinesTogether = false;
431
    this.isPresentationEditor = true;
432
    this.bAlignBySelected     = false;
433 434 435

    this.isPaintFormat = false;
    this.isViewMode = false;
436 437
    this.isShowTableEmptyLine = false;//true;
    this.isShowTableEmptyLineAttack = false;//true;
438 439 440 441 442 443 444 445 446 447 448

    this.bInit_word_control = false;
	this.isDocumentModify = false;

    this.isImageChangeUrl = false;
    this.isShapeImageChangeUrl = false;
    this.isSlideImageChangeUrl = false;
	
    this.isPasteFonts_Images = false;

    this.isLoadNoCutFonts = false;
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
449

450
    this.nCurPointItemsLength = -1;
451

452 453 454 455
    this.pasteCallback = null;
    this.pasteImageMap = null;
    this.EndActionLoadImages = 0;

Oleg.Korshul's avatar
Oleg.Korshul committed
456 457 458
    this.isSaveFonts_Images = false;
    this.saveImageMap = null;

459 460
    this.ServerImagesWaitComplete = false;

Oleg.Korshul's avatar
Oleg.Korshul committed
461
    this.ParcedDocument = false;
462
	this.isStartCoAuthoringOnEndLoad = false;	// Подсоединились раньше, чем документ загрузился
Oleg.Korshul's avatar
Oleg.Korshul committed
463

464
    this.DocumentOrientation = false;
465

466
    this.SelectedObjectsStack = [];
467

468
  this.CoAuthoringApi.isPowerPoint = true;
469

470 471 472
    // объекты, нужные для отправки в тулбар (шрифты, стили)
    this._gui_editor_themes = null;
    this._gui_document_themes = null;
Alexander.Trofimov's avatar
Alexander.Trofimov committed
473

Oleg.Korshul's avatar
Oleg.Korshul committed
474 475 476
    if (window.editor == undefined)
    {
        window.editor = this;
477
		window.editor;
Oleg.Korshul's avatar
Oleg.Korshul committed
478
        window['editor'] = window.editor;
Oleg.Korshul's avatar
Oleg.Korshul committed
479 480 481
        
        if (window["NATIVE_EDITOR_ENJINE"])
            editor = window.editor;
Oleg.Korshul's avatar
Oleg.Korshul committed
482
    }
483 484

  this._init();
485
}
486
AscCommon.extendClass(asc_docs_api, AscCommon.baseEditorsApi);
487

488 489 490 491
asc_docs_api.prototype.sendEvent = function() {
  this.asc_fireCallback.apply(this, arguments);
};

492 493 494 495
/////////////////////////////////////////////////////////////////////////
///////////////////CoAuthoring and Chat api//////////////////////////////
/////////////////////////////////////////////////////////////////////////
// Init CoAuthoring
Oleg.Korshul's avatar
 
Oleg.Korshul committed
496 497
asc_docs_api.prototype._coAuthoringSetChange = function(change, oColor)
{
498
	var oChange = new AscCommon.CCollaborativeChanges();
Oleg.Korshul's avatar
 
Oleg.Korshul committed
499 500
	oChange.Set_Data( change );
	oChange.Set_Color( oColor );
501
  AscCommon.CollaborativeEditing.Add_Changes( oChange );
Oleg.Korshul's avatar
 
Oleg.Korshul committed
502 503 504 505 506 507 508 509 510
};

asc_docs_api.prototype._coAuthoringSetChanges = function(e, oColor)
{
	var Count = e.length;
	for (var Index = 0; Index < Count; ++Index)
		this._coAuthoringSetChange(e[Index], oColor);
};

511
asc_docs_api.prototype._coAuthoringInitEnd = function() {
512 513
  var t = this;
  this.CoAuthoringApi.onCursor = function(e) {
514
    if (true === AscCommon.CollaborativeEditing.Is_Fast()) {
515
      t.WordControl.m_oLogicDocument.Update_ForeignCursor(e[e.length - 1]['cursor'], e[e.length - 1]['user'], true, e[e.length - 1]['useridoriginal']);
516 517 518
    }
  };
  this.CoAuthoringApi.onConnectionStateChanged = function(e) {
519
    if (true === AscCommon.CollaborativeEditing.Is_Fast() && false === e['state']) {
520
      editor.WordControl.m_oLogicDocument.Remove_ForeignCursor(e['id']);
521 522 523
    }
    t.asc_fireCallback("asc_onConnectionStateChanged", e);
  };
Alexander.Trofimov's avatar
Alexander.Trofimov committed
524 525 526
  this.CoAuthoringApi.onLocksAcquired = function(e) {
    if (t.isApplyChangesOnOpenEnabled) {
      // Пока документ еще не загружен, будем сохранять функцию и аргументы
527 528 529
      t.arrPreOpenLocksObjects.push(function() {
        t.CoAuthoringApi.onLocksAcquired(e);
      });
Alexander.Trofimov's avatar
Alexander.Trofimov committed
530 531
      return;
    }
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
532

Alexander.Trofimov's avatar
Alexander.Trofimov committed
533
    if (2 != e["state"]) {
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
534

Alexander.Trofimov's avatar
Alexander.Trofimov committed
535 536 537 538
      var block_value = e["blockValue"];
      var classes = [];
      switch (block_value["type"]) {
        case c_oAscLockTypeElemPresentation.Object:
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
539
        {
Alexander.Trofimov's avatar
Alexander.Trofimov committed
540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565
          classes.push(block_value["objId"]);
          //classes.push(block_value["slideId"]);
          break;
        }
        case c_oAscLockTypeElemPresentation.Slide:
        {
          classes.push(block_value["val"]);
          break;
        }
        case c_oAscLockTypeElemPresentation.Presentation:
        {
          break;
        }
      }

      for (var i = 0; i < classes.length; ++i) {
        var Class = g_oTableId.Get_ById(classes[i]);// g_oTableId.Get_ById( Id );
        if (null != Class) {
          var Lock = Class.Lock;

          var OldType = Class.Lock.Get_Type();
          if (locktype_Other2 === OldType || locktype_Other3 === OldType) {
            Lock.Set_Type(locktype_Other3, true);
          } else {
            Lock.Set_Type(locktype_Other, true);
          }
566
          if (Class instanceof AscCommonSlide.PropLocker) {
Alexander.Trofimov's avatar
Alexander.Trofimov committed
567
            var object = g_oTableId.Get_ById(Class.objectId);
568
            if (object instanceof AscCommonSlide.Slide && Class === object.deleteLock) {
Alexander.Trofimov's avatar
Alexander.Trofimov committed
569
              editor.WordControl.m_oLogicDocument.DrawingDocument.LockSlide(object.num);
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
570
            }
Alexander.Trofimov's avatar
Alexander.Trofimov committed
571 572 573 574
          }
          // Выставляем ID пользователя, залочившего данный элемент
          Lock.Set_UserId(e["user"]);

575
          if (Class instanceof AscCommonSlide.PropLocker) {
Alexander.Trofimov's avatar
Alexander.Trofimov committed
576
            var object = g_oTableId.Get_ById(Class.objectId);
577
            if (object instanceof AscCommonSlide.CPresentation) {
Alexander.Trofimov's avatar
Alexander.Trofimov committed
578 579 580 581 582 583 584
              if (Class === editor.WordControl.m_oLogicDocument.themeLock) {
                editor.asc_fireCallback("asc_onLockDocumentTheme");
              } else if (Class === editor.WordControl.m_oLogicDocument.schemeLock) {
                editor.asc_fireCallback("asc_onLockDocumentSchema");
              } else if (Class === editor.WordControl.m_oLogicDocument.slideSizeLock) {
                editor.asc_fireCallback("asc_onLockDocumentProps");
              }
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
585
            }
Alexander.Trofimov's avatar
Alexander.Trofimov committed
586
          }
587
          if (Class instanceof AscCommon.CComment) {
Alexander.Trofimov's avatar
Alexander.Trofimov committed
588 589 590 591 592 593 594 595 596 597
            editor.sync_LockComment(Class.Get_Id(), e["user"]);
          }

          // TODO: Здесь для ускорения надо сделать проверку, является ли текущим элемент с
          //       заданным Id. Если нет, тогда и не надо обновлять состояние.
          editor.WordControl.m_oLogicDocument.Document_UpdateInterfaceState();
        } else {
          if (classes[i].indexOf("new_object") > -1 && block_value["type"] === c_oAscLockTypeElemPresentation.Object) {
            var slide_id = block_value["slideId"];
            var delete_lock = g_oTableId.Get_ById(slide_id);
598
            if (AscCommon.isRealObject(delete_lock)) {
Alexander.Trofimov's avatar
Alexander.Trofimov committed
599 600 601 602 603 604 605 606 607
              var Lock = delete_lock.Lock;
              var OldType = Lock.Get_Type();
              if (locktype_Other2 === OldType || locktype_Other3 === OldType) {
                Lock.Set_Type(locktype_Other3, true);
              } else {
                Lock.Set_Type(locktype_Other, true);
              }
              editor.WordControl.m_oLogicDocument.DrawingDocument.LockSlide(g_oTableId.Get_ById(delete_lock.objectId).num);
            } else {
608
              AscCommon.CollaborativeEditing.Add_NeedLock(slide_id, e["user"]);
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
609
            }
Alexander.Trofimov's avatar
Alexander.Trofimov committed
610
          } else {
611
            AscCommon.CollaborativeEditing.Add_NeedLock(classes[i], e["user"]);
Alexander.Trofimov's avatar
Alexander.Trofimov committed
612
          }
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
613
        }
Alexander.Trofimov's avatar
Alexander.Trofimov committed
614 615 616 617 618 619
      }
    }
  };
  this.CoAuthoringApi.onLocksReleased = function(e, bChanges) {
    if (t.isApplyChangesOnOpenEnabled) {
      // Пока документ еще не загружен, будем сохранять функцию и аргументы
620 621 622
      t.arrPreOpenLocksObjects.push(function() {
        t.CoAuthoringApi.onLocksReleased(e, bChanges);
      });
Alexander.Trofimov's avatar
Alexander.Trofimov committed
623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661
      return;
    }

    var Id;
    var block_value = e["block"];
    var classes = [];
    switch (block_value["type"]) {
      case c_oAscLockTypeElemPresentation.Object:
      {
        classes.push(block_value["objId"]);
        //classes.push(block_value["slideId"]);
        break;
      }
      case c_oAscLockTypeElemPresentation.Slide:
      {
        classes.push(block_value["val"]);
        break;
      }
      case c_oAscLockTypeElemPresentation.Presentation:
      {
        break;
      }
    }
    for (var i = 0; i < classes.length; ++i) {
      Id = classes[i];
      var Class = g_oTableId.Get_ById(Id);
      if (null != Class) {
        var Lock = Class.Lock;

        if ("undefined" != typeof(Lock)) {
          var CurType = Lock.Get_Type();

          var NewType = locktype_None;

          if (CurType === locktype_Other) {
            if (true != bChanges) {
              NewType = locktype_None;
            } else {
              NewType = locktype_Other2;
662
              AscCommon.CollaborativeEditing.Add_Unlock(Class);
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
663
            }
Alexander.Trofimov's avatar
Alexander.Trofimov committed
664 665 666 667 668 669 670 671
          } else if (CurType === locktype_Mine) {
            // Такого быть не должно
            NewType = locktype_Mine;
          } else if (CurType === locktype_Other2 || CurType === locktype_Other3) {
            NewType = locktype_Other2;
          }

          Lock.Set_Type(NewType, true);
672
          if (Class instanceof AscCommonSlide.PropLocker) {
Alexander.Trofimov's avatar
Alexander.Trofimov committed
673
            var object = g_oTableId.Get_ById(Class.objectId);
674
            if (object instanceof AscCommonSlide.Slide && Class === object.deleteLock) {
Alexander.Trofimov's avatar
Alexander.Trofimov committed
675 676 677 678 679 680
              if (NewType !== locktype_Mine && NewType !== locktype_None) {
                editor.WordControl.m_oLogicDocument.DrawingDocument.LockSlide(object.num);
              } else {
                editor.WordControl.m_oLogicDocument.DrawingDocument.UnLockSlide(object.num);
              }
            }
681
            if (object instanceof AscCommonSlide.CPresentation) {
Alexander.Trofimov's avatar
Alexander.Trofimov committed
682 683 684 685 686 687 688 689 690 691 692 693 694 695
              if (Class === object.themeLock) {
                if (NewType !== locktype_Mine && NewType !== locktype_None) {
                  editor.asc_fireCallback("asc_onLockDocumentTheme");
                } else {
                  editor.asc_fireCallback("asc_onUnLockDocumentTheme");
                }
              }
              if (Class === object.slideSizeLock) {
                if (NewType !== locktype_Mine && NewType !== locktype_None) {
                  editor.asc_fireCallback("asc_onLockDocumentProps");
                } else {
                  editor.asc_fireCallback("asc_onUnLockDocumentProps");
                }
              }
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
696
            }
Alexander.Trofimov's avatar
Alexander.Trofimov committed
697 698 699

          }

Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
700
        }
Alexander.Trofimov's avatar
Alexander.Trofimov committed
701
      } else {
702
        AscCommon.CollaborativeEditing.Remove_NeedLock(Id);
Alexander.Trofimov's avatar
Alexander.Trofimov committed
703 704 705
      }
    }
  };
706 707
  this.CoAuthoringApi.onSaveChanges = function(e, userId, bFirstLoad) {
    // bSendEvent = false - это означает, что мы загружаем имеющиеся изменения при открытии
708
    var Changes = new AscCommon.CCollaborativeChanges();
709
    Changes.Set_Data(e);
710
    AscCommon.CollaborativeEditing.Add_Changes(Changes);
711 712 713 714 715 716

    // т.е. если bSendEvent не задан, то посылаем  сообщение + когда загрузился документ
    if (!bFirstLoad && t.bInit_word_control) {
      t.sync_CollaborativeChanges();
    }
  };
717
  this.CoAuthoringApi.onRecalcLocks = function(e) {
718
    if (e && true === AscCommon.CollaborativeEditing.Is_Fast()) {
719
      var CursorInfo = JSON.parse(e);
720
      AscCommon.CollaborativeEditing.Add_ForeignCursorToUpdate(CursorInfo.UserId, CursorInfo.CursorInfo, CursorInfo.UserShortId);
721 722
    }
  };
723 724
  this.CoAuthoringApi.onStartCoAuthoring = function(isStartEvent) {
    if (t.ParcedDocument) {
725
      AscCommon.CollaborativeEditing.Start_CollaborationEditing();
726 727 728
      t.WordControl.m_oLogicDocument.DrawingDocument.Start_CollaborationEditing();

      if (true != History.Is_Clear()) {
729 730
        AscCommon.CollaborativeEditing.Apply_Changes();
        AscCommon.CollaborativeEditing.Send_Changes();
731 732 733 734
      } else {
        // Изменений нет, но нужно сбросить lock
        t.CoAuthoringApi.unLockDocument(false);
      }
Alexander.Trofimov's avatar
Alexander.Trofimov committed
735
    } else {
736 737 738 739
      t.isStartCoAuthoringOnEndLoad = true;
    }
  };
  this.CoAuthoringApi.onEndCoAuthoring = function(isStartEvent) {
740
    AscCommon.CollaborativeEditing.End_CollaborationEditing();
741 742 743 744

    if (false != t.WordControl.m_oLogicDocument.DrawingDocument.IsLockObjectsEnable) {
      t.WordControl.m_oLogicDocument.DrawingDocument.IsLockObjectsEnable = false;
      t.WordControl.m_oLogicDocument.DrawingDocument.FirePaint();
Alexander.Trofimov's avatar
Alexander.Trofimov committed
745 746
    }
  };
747
};
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
748 749 750 751 752 753 754 755


asc_docs_api.prototype.pre_Save = function(_images)
{
    this.isSaveFonts_Images = true;
    this.saveImageMap = _images;
    this.WordControl.m_oDrawingDocument.CheckFontNeeds();
    this.FontLoader.LoadDocumentFonts2(this.WordControl.m_oLogicDocument.Fonts);
756
};
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
757

758 759 760

asc_docs_api.prototype.asc_SetFastCollaborative = function(isOn)
{
761 762
    if (AscCommon.CollaborativeEditing)
      AscCommon.CollaborativeEditing.Set_Fast(isOn);
763 764
};

Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
765 766
asc_docs_api.prototype.sync_CollaborativeChanges = function()
{
767
    if (true !== AscCommon.CollaborativeEditing.Is_Fast())
768
        this.asc_fireCallback("asc_onCollaborativeChanges");
769
};
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
770

771
asc_docs_api.prototype.asyncServerIdEndLoaded = function () {
772 773 774
    this.ServerIdWaitComplete = true;
    if (true == this.ServerImagesWaitComplete)
        this.OpenDocumentEndCallback();
775
};
776 777 778 779

// Эвент о пришедщих изменениях
asc_docs_api.prototype.syncCollaborativeChanges = function () {
	this.asc_fireCallback("asc_onCollaborativeChanges");
780
};
781

Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
782 783 784 785

asc_docs_api.prototype.SetCollaborativeMarksShowType = function(Type)
{
    this.CollaborativeMarksShowType = Type;
786
};
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
787 788 789 790

asc_docs_api.prototype.GetCollaborativeMarksShowType = function(Type)
{
    return this.CollaborativeMarksShowType;
791
};
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
792 793 794

asc_docs_api.prototype.Clear_CollaborativeMarks = function()
{
795
  AscCommon.CollaborativeEditing.Clear_CollaborativeMarks(true);
796 797 798
};

asc_docs_api.prototype._onUpdateDocumentCanSave = function () {
799
    var CollEditing = AscCommon.CollaborativeEditing;
800 801 802 803 804 805 806 807 808 809 810 811

    // Можно модифицировать это условие на более быстрое (менять самим состояние в аргументах, а не запрашивать каждый раз)
    var isCanSave = this.isDocumentModified() || (true !== CollEditing.Is_SingleUser() && 0 !== CollEditing.getOwnLocksLength());

    if (true === CollEditing.Is_Fast() && true !== CollEditing.Is_SingleUser())
        isCanSave = false;

    if (isCanSave !== this.isDocumentCanSave)
    {
        this.isDocumentCanSave = isCanSave;
        this.asc_fireCallback('asc_onDocumentCanSaveChanged', this.isDocumentCanSave);
    }
812
};
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
813

814
///////////////////////////////////////////
Oleg.Korshul's avatar
Oleg.Korshul committed
815 816 817 818 819 820 821 822 823 824 825 826 827 828 829
asc_docs_api.prototype.CheckChangedDocument = function()
{
    if (true === History.Have_Changes())
    {
        // дублирование евента. когда будет undo-redo - тогда
        // эти евенты начнут отличаться
        this.SetDocumentModified(true);
    }
    else
    {
        this.SetDocumentModified(false);
    }

    this._onUpdateDocumentCanSave();
};
830 831
asc_docs_api.prototype.SetUnchangedDocument = function()
{
832
    this.SetDocumentModified(false);
833
    this._onUpdateDocumentCanSave();
834
};
835

836 837 838 839 840 841 842 843 844 845 846
asc_docs_api.prototype.SetDocumentModified = function(bValue)
{
    this.isDocumentModify = bValue;
    this.asc_fireCallback("asc_onDocumentModifiedChanged");

    if (undefined !== window["AscDesktopEditor"])
    {
        window["AscDesktopEditor"]["onDocumentModifiedChanged"](bValue);
    }
};

847 848
asc_docs_api.prototype.isDocumentModified = function()
{
849 850 851 852
	if (!this.canSave) {
		// Пока идет сохранение, мы не закрываем документ
		return true;
	}
853
    return this.isDocumentModify;
854 855
};

856 857 858 859
asc_docs_api.prototype.sync_BeginCatchSelectedElements = function()
{
    if (0 != this.SelectedObjectsStack.length)
        this.SelectedObjectsStack.splice(0, this.SelectedObjectsStack.length);
860
};
861
asc_docs_api.prototype.sync_EndCatchSelectedElements = function()
862 863
{
    this.asc_fireCallback("asc_onFocusObject", this.SelectedObjectsStack);
864
};
865 866 867
asc_docs_api.prototype.getSelectedElements = function()
{
    return this.SelectedObjectsStack;
868
};
869 870 871 872 873 874
asc_docs_api.prototype.sync_ChangeLastSelectedElement = function(type, obj)
{			
	var oUnkTypeObj = null;
			
	switch( type )
	{
875
		case c_oAscTypeSelectElement.Paragraph: oUnkTypeObj = new Asc.asc_CParagraphProperty( obj );
876
			break;
877
		case c_oAscTypeSelectElement.Image: oUnkTypeObj = new Asc.asc_CImgProperty( obj );
878
			break;
879
		case c_oAscTypeSelectElement.Table: oUnkTypeObj = new Asc.CTableProp( obj );
880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900
			break;
		case c_oAscTypeSelectElement.Shape: oUnkTypeObj = obj;
			break;
	}
			
    var _i = this.SelectedObjectsStack.length - 1;
    var bIsFound = false;
    while (_i >= 0)
    {
        if (this.SelectedObjectsStack[_i].Type == type)
        {

            this.SelectedObjectsStack[_i].Value = oUnkTypeObj;
            bIsFound = true;
            break;
        }
        _i--;
    }

    if (!bIsFound)
    {
901
        this.SelectedObjectsStack[this.SelectedObjectsStack.length] = new asc_CSelectedObject ( type, oUnkTypeObj );
902
    }
903
};
904

905 906
asc_docs_api.prototype.Init = function() {
  this.WordControl.Init();
907
};
908
asc_docs_api.prototype.asc_setLocale = function(val) {
909
};
910 911 912

asc_docs_api.prototype.SetThemesPath = function(path)
{
913 914 915 916 917
  if (!this.isLoadFullApi) {
    this.tmpThemesPath = path;
    return;
  }

918
    this.ThemeLoader.ThemesUrl = path;
919
    if (this.documentOrigin) {
920
        this.ThemeLoader.ThemesUrlAbs = AscCommon.joinUrls(this.documentOrigin + this.documentPathname, path);
921 922 923
    } else {
        this.ThemeLoader.ThemesUrlAbs = path;
    }
924
};
925 926 927

asc_docs_api.prototype.CreateCSS = function()
{
Oleg.Korshul's avatar
Oleg.Korshul committed
928 929
    if (window["flat_desine"] === true)
    {
930
      AscCommonSlide.updateGlobalSkin(AscCommonSlide.GlobalSkinFlat);
Oleg.Korshul's avatar
Oleg.Korshul committed
931 932
    }

933 934 935 936 937 938 939 940 941 942
    var _head = document.getElementsByTagName('head')[0];

    var style0 = document.createElement('style');
    style0.type = 'text/css';
    style0.innerHTML = ".block_elem { position:absolute;padding:0;margin:0; }";
    _head.appendChild(style0);

    var style1 = document.createElement('style');
    style1.type = 'text/css';
    style1.innerHTML = ".buttonTabs {\
943
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAA5CAMAAADjueCuAAAABGdBTUEAALGPC/xhBQAAAEhQTFRFAAAAWFhYZWVlSEhIY2NjV1dXQ0NDYWFhYmJiTk5OVlZWYGBgVFRUS0tLbGxsRERETExMZmZmVVVVXl5eR0dHa2trPj4+u77CpAZQrwAAAAF0Uk5TAEDm2GYAAABwSURBVDjL1dHHDoAgEEVR7NLr4P//qQm6EMaFxtje8oTF5ELIpU35Fstf3GegsPEBG+uwSYpNB1qNKreoDeNw/r6dLr/tnFpbbNZj8wKbk8W/1d6ZPjfrhdHx9c4fbA9wzMYWm3OFhbQmbC2ue6z9DCH/Exf/mU3YAAAAAElFTkSuQmCC);\
944 945 946 947 948 949 950 951
background-position: 0px 0px;\
background-repeat: no-repeat;\
}";
    _head.appendChild(style1);

    var style3 = document.createElement('style');
    style3.type = 'text/css';
    style3.innerHTML = ".buttonPrevPage {\
952
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAABgBAMAAADm/++TAAAABGdBTUEAALGPC/xhBQAAABJQTFRFAAAA////UVNVu77Cenp62Nrc3x8hMQAAAAF0Uk5TAEDm2GYAAABySURBVCjPY2AgETDBGEoKUAElJcJSxANjKGAwDQWDYAKMIBhDSRXCCFJSIixF0GS4M+AMExcwcCbAcIQxBEUgDEdBQcJSBE2GO4PU6IJHASxS4NGER4p28YWIAlikwKMJjxTt4gsRBbBIgUcTHini4wsAwMmIvYZODL0AAAAASUVORK5CYII=);\
953 954 955 956 957 958 959 960
background-position: 0px 0px;\
background-repeat: no-repeat;\
}";
    _head.appendChild(style3);

    var style4 = document.createElement('style');
    style4.type = 'text/css';
    style4.innerHTML = ".buttonNextPage {\
961
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAABgBAMAAADm/++TAAAABGdBTUEAALGPC/xhBQAAABJQTFRFAAAA////UVNVu77Cenp62Nrc3x8hMQAAAAF0Uk5TAEDm2GYAAABySURBVCjPY2AgETDBGEoKUAElJcJSxANjKGAwDQWDYAKMIBhDSRXCCFJSIixF0GS4M+AMExcwcCbAcIQxBEUgDEdBQcJSBE2GO4PU6IJHASxS4NGER4p28YWIAlikwKMJjxTt4gsRBbBIgUcTHini4wsAwMmIvYZODL0AAAAASUVORK5CYII=);\
962 963 964 965
background-position: 0px -48px;\
background-repeat: no-repeat;\
}";
    _head.appendChild(style4);
966
};
967 968 969 970 971

asc_docs_api.prototype.CreateComponents = function()
{
    this.CreateCSS();

972 973 974
    var _main_border_style = "border-bottom-width: 1px;border-bottom-color:" + AscCommonSlide.GlobalSkin.BorderSplitterColor + "; border-bottom-style: solid;";
    var _thumbnail_style_right = "border-right-width: 1px;border-right-color:" + AscCommonSlide.GlobalSkin.BorderSplitterColor + "; border-right-style: solid;";
    if (!AscCommonSlide.GlobalSkin.SupportNotes)
975 976 977 978 979
    {
        _main_border_style = "";
        _thumbnail_style_right = "";
    }

980
    var _innerHTML = "<div id=\"id_panel_thumbnails\" class=\"block_elem\" style=\"background-color:" + AscCommonSlide.GlobalSkin.BackgroundColorThumbnails + ";" + _thumbnail_style_right + "\">\
981 982
		                            <canvas id=\"id_thumbnails_background\" class=\"block_elem\" style=\"-webkit-user-select: none;background-color:#EBEBEB;z-index:1\"></canvas>\
		                            <canvas id=\"id_thumbnails\" class=\"block_elem\" style=\"-webkit-user-select: none;z-index:2\"></canvas>\
Dmitry.Shahtanov's avatar
Dmitry.Shahtanov committed
983 984
		                            <div id=\"id_vertical_scroll_thmbnl\" style=\"left:0;top:0;width:1px;overflow:hidden;position:absolute;\">\
									    <div id=\"panel_right_scroll_thmbnl\" class=\"block_elem\" style=\"left:0;top:0;width:1px;height:6000px;\"></div>\
985 986
									</div>\
		                        </div>\
987
                            <div id=\"id_main\" class=\"block_elem\" style=\"-moz-user-select:none;-khtml-user-select:none;user-select:none;background-color:" + AscCommonSlide.GlobalSkin.BackgroundColor + ";overflow:hidden;border-left-width: 1px;border-left-color:" + AscCommonSlide.GlobalSkin.BorderSplitterColor + "; border-left-style: solid;" + _main_border_style + "\" UNSELECTABLE=\"on\">\
988
								<div id=\"id_panel_left\" class=\"block_elem\">\
989
									<canvas id=\"id_buttonTabs\" class=\"block_elem\"></canvas>\
990 991 992 993 994 995
									<canvas id=\"id_vert_ruler\" class=\"block_elem\"></canvas>\
								</div>\
                                <div id=\"id_panel_top\" class=\"block_elem\">\
									<canvas id=\"id_hor_ruler\" class=\"block_elem\"></canvas>\
                                </div>\
                                <div id=\"id_main_view\" class=\"block_elem\" style=\"overflow:hidden\">\
996 997
                                    <canvas id=\"id_viewer\" class=\"block_elem\" style=\"-webkit-user-select: none;background-color:#B0B0B0;z-index:1\"></canvas>\
                                    <canvas id=\"id_viewer_overlay\" class=\"block_elem\" style=\"-webkit-user-select: none;z-index:2\"></canvas>\
998
                                    <canvas id=\"id_target_cursor\" class=\"block_elem\" width=\"1\" height=\"1\" style=\"-webkit-user-select: none;width:2px;height:13px;display:none;z-index:4;\"></canvas>\
999
                                </div>\
1000
							    <div id=\"id_panel_right\" class=\"block_elem\" style=\"margin-right:1px;background-color:#F1F1F1;\">\
1001
							        <div id=\"id_buttonRulers\" class=\"block_elem buttonRuler\"></div>\
Dmitry.Shahtanov's avatar
Dmitry.Shahtanov committed
1002 1003
								    <div id=\"id_vertical_scroll\" style=\"left:0;top:0;width:14px;overflow:hidden;position:absolute;\">\
									    <div id=\"panel_right_scroll\" class=\"block_elem\" style=\"left:0;top:0;width:1px;height:6000px;\"></div>\
1004 1005 1006 1007 1008
								    </div>\
								    <div id=\"id_buttonPrevPage\" class=\"block_elem buttonPrevPage\"></div>\
								    <div id=\"id_buttonNextPage\" class=\"block_elem buttonNextPage\"></div>\
                                </div>\
                                <div id=\"id_horscrollpanel\" class=\"block_elem\" style=\"margin-bottom:1px;background-color:#B0B0B0;\">\
Dmitry.Shahtanov's avatar
Dmitry.Shahtanov committed
1009 1010
                                    <div id=\"id_horizontal_scroll\" style=\"left:0;top:0;height:14px;overflow:hidden;position:absolute;width:100%;\">\
                                        <div id=\"panel_hor_scroll\" class=\"block_elem\" style=\"left:0;top:0;width:6000px;height:1px;\"></div>\
1011 1012
                                    </div>\
                                </div>\
1013 1014 1015 1016
                            </div>";

    if (true)
    {
1017
        _innerHTML += "<div id=\"id_panel_notes\" class=\"block_elem\" style=\"background-color:#FFFFFF;border-left-width: 1px;border-left-color:" + AscCommonSlide.GlobalSkin.BorderSplitterColor + "; border-left-style: solid;border-top-width: 1px;border-top-color:" + AscCommonSlide.GlobalSkin.BorderSplitterColor + "; border-top-style: solid;\">\
1018 1019 1020 1021 1022
                                <canvas id=\"id_notes\" class=\"block_elem\" style=\"background-color:#FFFFFF;z-index:1\"></canvas>\
                                <div id=\"id_vertical_scroll_notes\" style=\"left:0;top:0;width:16px;overflow:hidden;position:absolute;\">\
                                    <div id=\"panel_right_scroll_notes\" class=\"block_elem\" style=\"left:0;top:0;width:16px;height:6000px;\"></div>\
                                </div>\
                            </div>";
1023 1024
    }

1025
	if (this.HtmlElement != null)
1026
    {
1027 1028
        if (AscCommonSlide.GlobalSkin.Name == "flat")
          this.HtmlElement.style.backgroundColor = AscCommonSlide.GlobalSkin.BackgroundColorThumbnails;
1029

1030
      this.HtmlElement.innerHTML = _innerHTML;
1031
    }
1032
};
1033 1034 1035

asc_docs_api.prototype.InitEditor = function()
{
1036
    this.WordControl.m_oLogicDocument   = new AscCommonSlide.CPresentation(this.WordControl.m_oDrawingDocument);
1037
    this.WordControl.m_oDrawingDocument.m_oLogicDocument = this.WordControl.m_oLogicDocument;
1038
};
1039 1040 1041

asc_docs_api.prototype.SetInterfaceDrawImagePlaceSlide = function(div_id)
{
1042 1043 1044 1045
  if (!this.isLoadFullApi) {
    this.tmpSlideDiv = div_id;
    return;
  }
1046
    this.WordControl.m_oDrawingDocument.InitGuiCanvasSlide(div_id);
1047
};
1048 1049 1050

asc_docs_api.prototype.SetInterfaceDrawImagePlaceTextArt = function(div_id)
{
1051 1052 1053 1054
  if (!this.isLoadFullApi) {
    this.tmpTextArtDiv = div_id;
    return;
  }
1055 1056 1057
    this.WordControl.m_oDrawingDocument.InitGuiCanvasTextArt(div_id);
};

1058 1059 1060 1061
asc_docs_api.prototype.OpenDocument2 = function(url, gObject)
{
	this.InitEditor();
	this.DocumentType = 2;
Oleg.Korshul's avatar
Oleg.Korshul committed
1062

1063
    var _loader = new AscCommon.BinaryPPTYLoader();
1064

1065
    _loader.Api = this;
1066
    g_oIdCounter.Set_Load(true);
Oleg.Korshul's avatar
Oleg.Korshul committed
1067
    _loader.Load(gObject, this.WordControl.m_oLogicDocument);
1068
    this.WordControl.m_oLogicDocument.Set_FastCollaborativeEditing(true);
Oleg.Korshul's avatar
Oleg.Korshul committed
1069
    _loader.Check_TextFit();
1070

1071 1072 1073
    if (History && History.Update_FileDescription)
        History.Update_FileDescription(_loader.stream);

1074
	this.LoadedObject = 1;
1075
    g_oIdCounter.Set_Load(false);
1076 1077 1078

    this.sync_EndAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.Open);

1079
	//this.FontLoader.LoadEmbeddedFonts(this.DocumentUrl, this.WordControl.m_oLogicDocument.EmbeddedFonts);
1080
	this.FontLoader.LoadDocumentFonts(this.WordControl.m_oLogicDocument.Fonts, false);
Oleg.Korshul's avatar
Oleg.Korshul committed
1081

Oleg.Korshul's avatar
Oleg.Korshul committed
1082
    this.ParcedDocument = true;
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
1083
    g_oIdCounter.Set_Load(false);
1084 1085 1086 1087
	if (this.isStartCoAuthoringOnEndLoad) {
		this.CoAuthoringApi.onStartCoAuthoring(true);
		this.isStartCoAuthoringOnEndLoad = false;
	}
Oleg.Korshul's avatar
Oleg.Korshul committed
1088

Oleg.Korshul's avatar
Oleg.Korshul committed
1089 1090
    if (this.isMobileVersion)
    {
1091
      AscCommon.AscBrowser.isSafariMacOs = false;
1092 1093
      PasteElementsId.PASTE_ELEMENT_ID = "wrd_pastebin";
      PasteElementsId.ELEMENT_DISPAY_STYLE = "none";
Oleg.Korshul's avatar
Oleg.Korshul committed
1094 1095
    }

1096
    if (AscCommon.AscBrowser.isSafariMacOs)
1097
        setInterval(AscCommon.SafariIntervalFocus, 10);
1098
};
1099

1100 1101 1102
asc_docs_api.prototype._OfflineAppDocumentEndLoad = function() {
  if (undefined == window["editor_bin"])
    return;
1103

Alexander.Trofimov's avatar
Alexander.Trofimov committed
1104
  this.OpenDocument2(this.documentUrl, window["editor_bin"]);
1105 1106
  //callback
  this.DocumentOrientation = (null == this.WordControl.m_oLogicDocument) ? true : !this.WordControl.m_oLogicDocument.Orientation;
1107
};
1108 1109 1110 1111 1112 1113 1114
// Callbacks
/* все имена callback'оф начинаются с On. Пока сделаны: 
	OnBold, 
	OnItalic, 
	OnUnderline, 
	OnTextPrBaseline(возвращается расположение строки - supstring, superstring, baseline), 
	OnPrAlign(выравнивание по ширине, правому краю, левому краю, по центру), 
1115
	OnListType( возвращается AscCommon.asc_CListType )
1116 1117 1118 1119 1120

	фейк-функции ожидающие TODO:
	Print,Undo,Redo,Copy,Cut,Paste,Share,Save,Download & callbacks
	OnFontName, OnFontSize, OnLineSpacing

1121
	OnFocusObject( возвращается массив asc_CSelectedObject )
1122 1123
	OnInitEditorStyles( возвращается CStylesPainter )
	OnSearchFound( возвращается CSearchResult );
1124
	OnParaSpacingLine( возвращается AscCommon.asc_CParagraphSpacing )
1125
	OnLineSpacing( не используется? )
1126 1127
	OnTextColor( возвращается AscCommon.CColor )
	OnTextHightLight( возвращается AscCommon.CColor )
1128
	OnInitEditorFonts( возвращается массив объектов СFont )
1129
	OnFontFamily( возвращается asc_CTextFontFamily )
1130 1131 1132 1133 1134
*/
var _callbacks = {};

asc_docs_api.prototype.asc_registerCallback = function(name, callback) {
	if (!_callbacks.hasOwnProperty(name))
1135
		_callbacks[name] = [];
1136
	_callbacks[name].push(callback);
1137
};
1138 1139 1140 1141 1142 1143 1144 1145

asc_docs_api.prototype.asc_unregisterCallback = function(name, callback) {
	if (_callbacks.hasOwnProperty(name)) {
		for (var i = _callbacks[name].length - 1; i >= 0 ; --i) {
			if (_callbacks[name][i] == callback)
				_callbacks[name].splice(i, 1);
		}
	}
1146
};
1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158

asc_docs_api.prototype.asc_fireCallback = function(name)
{
	if (_callbacks.hasOwnProperty(name))
    {
		for (var i = 0; i < _callbacks[name].length; ++i)
        {
			_callbacks[name][i].apply(this || window, Array.prototype.slice.call(arguments, 1));
		}
        return true;
	}
    return false;
1159
};
1160 1161 1162 1163 1164 1165
asc_docs_api.prototype.asc_checkNeedCallback = function(name) {
    if (_callbacks.hasOwnProperty(name))
    {
        return true;
    }
    return false;
1166
};
1167 1168 1169 1170 1171 1172 1173 1174 1175

// get functions
asc_docs_api.prototype.get_TextProps = function()
{
	var Doc = this.WordControl.m_oLogicDocument;
	var ParaPr = Doc.Get_Paragraph_ParaPr();
	var TextPr = Doc.Get_Paragraph_TextPr();

	// return { ParaPr: ParaPr, TextPr : TextPr };
1176
	return new AscCommonSlide.CParagraphAndTextProp (ParaPr, TextPr);	// uncomment if this method will be used externally. 20/03/2012 uncommented for testers
1177
};
1178

Oleg.Korshul's avatar
Oleg.Korshul committed
1179 1180 1181 1182 1183 1184
// -------
// тут методы, замены евентов
asc_docs_api.prototype.get_PropertyEditorThemes = function()
{
    var ret = [this._gui_editor_themes, this._gui_document_themes];
    return ret;
1185
};
Oleg.Korshul's avatar
Oleg.Korshul committed
1186 1187 1188

// -------

1189 1190 1191 1192
// -------
asc_docs_api.prototype.get_ContentCount = function()
{
	return this.WordControl.m_oLogicDocument.Content.length;
1193
};
1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206

asc_docs_api.prototype.select_Element = function(Index)
{
	var Document = this.WordControl.m_oLogicDocument;

	if ( true === Document.Selection.Use )
		Document.Selection_Remove();

	Document.DrawingDocument.SelectEnabled(true);
	Document.DrawingDocument.TargetEnd();

	Document.Selection.Use      = true;
	Document.Selection.Start    = false;
Alexander.Trofimov's avatar
Alexander.Trofimov committed
1207
	Document.Selection.Flag     = AscCommon.selectionflag_Common;
1208 1209 1210 1211 1212 1213 1214 1215 1216

	Document.Selection.StartPos = Index;
	Document.Selection.EndPos   = Index;

	Document.Content[Index].Selection.Use      = true;
	Document.Content[Index].Selection.StartPos = Document.Content[Index].Internal_GetStartPos();
	Document.Content[Index].Selection.EndPos   = Document.Content[Index].Content.length - 1;

	Document.Selection_Draw();
1217
};
1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241

asc_docs_api.prototype.UpdateTextPr = function(TextPr)
{
	if ( "undefined" != typeof(TextPr) )
	{
        if (TextPr.Color !== undefined)
        {
            this.WordControl.m_oDrawingDocument.TargetCursorColor.R = TextPr.Color.r;
            this.WordControl.m_oDrawingDocument.TargetCursorColor.G = TextPr.Color.g;
            this.WordControl.m_oDrawingDocument.TargetCursorColor.B = TextPr.Color.b;
        }
        if(TextPr.Bold === undefined)
            TextPr.Bold = false;
        if(TextPr.Italic === undefined)
            TextPr.Italic = false;
        if(TextPr.Underline === undefined)
            TextPr.Underline = false;
        if(TextPr.Strikeout === undefined)
            TextPr.Strikeout = false;
        if(TextPr.FontFamily === undefined)
            TextPr.FontFamily = {Index : 0, Name : ""};
        if(TextPr.FontSize === undefined)
            TextPr.FontSize = "";

1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263
        this.sync_BoldCallBack(TextPr.Bold);
        this.sync_ItalicCallBack(TextPr.Italic);
        this.sync_UnderlineCallBack(TextPr.Underline);
        this.sync_StrikeoutCallBack(TextPr.Strikeout);
        this.sync_TextPrFontSizeCallBack(TextPr.FontSize);
        this.sync_TextPrFontFamilyCallBack(TextPr.FontFamily);

        if (TextPr.VertAlign !== undefined)
            this.sync_VerticalAlign(TextPr.VertAlign);
        if (TextPr.Spacing !== undefined)
            this.sync_TextSpacing(TextPr.Spacing);
        if (TextPr.DStrikeout !== undefined)
            this.sync_TextDStrikeout(TextPr.DStrikeout);
        if (TextPr.Caps !== undefined)
            this.sync_TextCaps(TextPr.Caps);
        if (TextPr.SmallCaps !== undefined)
            this.sync_TextSmallCaps(TextPr.SmallCaps);
        if (TextPr.Position !== undefined)
            this.sync_TextPosition(TextPr.Position);
        if (TextPr.Lang !== undefined)
            this.sync_TextLangCallBack(TextPr.Lang);
		
1264
        if (TextPr.Unifill !== undefined)
1265
        {
1266
            this.sync_TextColor2(TextPr.Unifill);
1267 1268
        }
	}
1269
};
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
1270 1271 1272 1273

asc_docs_api.prototype.sync_TextSpacing = function(Spacing)
{
    this.asc_fireCallback("asc_onTextSpacing", Spacing );
1274
};
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
1275 1276 1277
asc_docs_api.prototype.sync_TextDStrikeout = function(Value)
{
    this.asc_fireCallback("asc_onTextDStrikeout", Value );
1278
};
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
1279 1280 1281
asc_docs_api.prototype.sync_TextCaps = function(Value)
{
    this.asc_fireCallback("asc_onTextCaps", Value );
1282
};
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
1283 1284 1285
asc_docs_api.prototype.sync_TextSmallCaps = function(Value)
{
    this.asc_fireCallback("asc_onTextSmallCaps", Value );
1286
};
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
1287 1288 1289
asc_docs_api.prototype.sync_TextPosition = function(Value)
{
    this.asc_fireCallback("asc_onTextPosition", Value );
1290
};
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
1291 1292 1293
asc_docs_api.prototype.sync_TextLangCallBack = function(Lang)
{
    this.asc_fireCallback("asc_onTextLanguage", Lang.Val );
1294
};
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
1295

1296 1297 1298
asc_docs_api.prototype.sync_VerticalTextAlign = function(align)
{
    this.asc_fireCallback("asc_onVerticalTextAlign", align);
1299
};
1300 1301 1302 1303
asc_docs_api.prototype.sync_Vert = function(vert)
{
    this.asc_fireCallback("asc_onVert", vert);
};
1304

1305
asc_docs_api.prototype.UpdateParagraphProp = function(ParaPr, bParaPr){
1306

1307
    ParaPr.StyleName = "";
1308
    var TextPr = editor.WordControl.m_oLogicDocument.Get_Paragraph_TextPr();
1309 1310
    ParaPr.Subscript   = ( TextPr.VertAlign === AscCommon.vertalign_SubScript   ? true : false );
    ParaPr.Superscript = ( TextPr.VertAlign === AscCommon.vertalign_SuperScript ? true : false );
1311 1312 1313 1314 1315 1316 1317
    ParaPr.Strikeout   = TextPr.Strikeout;
    ParaPr.DStrikeout  = TextPr.DStrikeout;
    ParaPr.AllCaps     = TextPr.Caps;
    ParaPr.SmallCaps   = TextPr.SmallCaps;
    ParaPr.TextSpacing = TextPr.Spacing;
    ParaPr.Position    = TextPr.Position;
    if(ParaPr.Bullet)
1318
    {
1319 1320 1321 1322 1323
        var ListType = {
            Type: -1,
            SubType: -1
        };
        if(ParaPr.Bullet && ParaPr.Bullet.bulletType)
1324
        {
1325
            switch (ParaPr.Bullet.bulletType.type)
1326
            {
1327
                case AscFormat.BULLET_TYPE_BULLET_CHAR:
1328
                {
1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368
                    ListType.Type = 0;
                    ListType.SubType = undefined;
                    switch(ParaPr.Bullet.bulletType.Char)
                    {
                        case "":
                        {
                            ListType.SubType = 1;
                            break;
                        }
                        case  "o":
                        {
                            ListType.SubType = 2;
                            break;
                        }
                        case  "§":
                        {
                            ListType.SubType = 3;
                            break;
                        }
                        case  String.fromCharCode( 0x0076 ):
                        {
                            ListType.SubType = 4;
                            break;
                        }
                        case  String.fromCharCode( 0x00D8 ):
                        {
                            ListType.SubType = 5;
                            break;
                        }
                        case  String.fromCharCode( 0x00FC ):
                        {
                            ListType.SubType = 6;
                            break;
                        }
                        case String.fromCharCode( 119 ):
                        {
                            ListType.SubType = 7;
                            break;
                        }
                    }
1369 1370
                    break;
                }
1371
                case AscFormat.BULLET_TYPE_BULLET_BLIP:
1372
                {
1373 1374 1375 1376
                    ListType.Type = 0;
                    ListType.SubType = undefined;
                    break;
                }
1377
                case AscFormat.BULLET_TYPE_BULLET_AUTONUM:
1378 1379 1380
                {
                    ListType.Type = 1;
                    ListType.SubType = undefined;
1381
                    if(AscFormat.isRealNumber(ParaPr.Bullet.bulletType.AutoNumType))
1382
                    {
Alexander.Trofimov's avatar
Alexander.Trofimov committed
1383
                        var AutoNumType = AscCommonWord.g_NumberingArr[ParaPr.Bullet.bulletType.AutoNumType] - 99;
1384 1385 1386 1387 1388
                        if(AutoNumType > 0 && AutoNumType < 9)
                        {
                            ListType.SubType = AutoNumType;
                        }
                    }
1389 1390 1391 1392
                    break;
                }
            }
        }
1393 1394 1395
        ParaPr.ListType = ListType;
    }
    else
1396
    {
1397 1398
        ParaPr.ListType = {Type: -1, SubType: -1};
    }
1399 1400 1401 1402 1403
	this.sync_ParaSpacingLine( ParaPr.Spacing );
	this.Update_ParaInd(ParaPr.Ind);
	this.sync_PrAlignCallBack(ParaPr.Jc);
	this.sync_ParaStyleName(ParaPr.StyleName);
	this.sync_ListType(ParaPr.ListType);
1404 1405
    if(!(bParaPr === true))
	    this.sync_PrPropCallback(ParaPr);
1406
};
1407 1408 1409
/*----------------------------------------------------------------*/
/*functions for working with clipboard, document*/
/*TODO: Print,Undo,Redo,Copy,Cut,Paste,Share,Save,DownloadAs,ReturnToDocuments(вернуться на предыдущую страницу) & callbacks for these functions*/
1410
asc_docs_api.prototype.asc_Print = function(bIsDownloadEvent){
Oleg.Korshul's avatar
Oleg.Korshul committed
1411 1412 1413 1414 1415 1416

    if (window["AscDesktopEditor"])
    {
        window["AscDesktopEditor"]["Print"]();
        return;
    }
1417
    var options = {downloadType: bIsDownloadEvent ? DownloadType.Print: DownloadType.None};
1418
	this._downloadAs(c_oAscFileType.PDF, c_oAscAsyncAction.Print, options);
1419
};
1420 1421
asc_docs_api.prototype.Undo = function(){
	this.WordControl.m_oLogicDocument.Document_Undo();
1422
};
1423 1424
asc_docs_api.prototype.Redo = function(){
	this.WordControl.m_oLogicDocument.Document_Redo();
1425
};
1426 1427 1428 1429
asc_docs_api.prototype.Copy = function()
{
    if (window["AscDesktopEditor"])
    {
Alexander.Trofimov's avatar
Alexander.Trofimov committed
1430
        var _e = new AscCommon.CKeyboardEvent();
1431 1432 1433
        _e.CtrlKey = true;
        _e.KeyCode = 67;

Oleg.Korshul's avatar
 
Oleg.Korshul committed
1434
		window["AscDesktopEditorButtonMode"] = true;
1435
        this.WordControl.m_oLogicDocument.OnKeyDown(_e);
Oleg.Korshul's avatar
 
Oleg.Korshul committed
1436
		window["AscDesktopEditorButtonMode"] = false;
1437 1438 1439

        return;
    }
1440
	return AscCommon.Editor_Copy_Button(this);
1441
};
1442 1443
asc_docs_api.prototype.Update_ParaTab = function(Default_Tab, ParaTabs){
    this.WordControl.m_oDrawingDocument.Update_ParaTab(Default_Tab, ParaTabs);
1444
};
1445 1446 1447 1448
asc_docs_api.prototype.Cut = function()
{
    if (window["AscDesktopEditor"])
    {
Alexander.Trofimov's avatar
Alexander.Trofimov committed
1449
        var _e = new AscCommon.CKeyboardEvent();
1450 1451 1452
        _e.CtrlKey = true;
        _e.KeyCode = 88;

Oleg.Korshul's avatar
 
Oleg.Korshul committed
1453
		window["AscDesktopEditorButtonMode"] = true;
1454
        this.WordControl.m_oLogicDocument.OnKeyDown(_e);
Oleg.Korshul's avatar
 
Oleg.Korshul committed
1455
		window["AscDesktopEditorButtonMode"] = false;
1456 1457 1458

        return;
    }
1459
	return AscCommon.Editor_Copy_Button(this, true);
1460
};
1461 1462 1463 1464
asc_docs_api.prototype.Paste = function()
{
    if (window["AscDesktopEditor"])
    {
Alexander.Trofimov's avatar
Alexander.Trofimov committed
1465
        var _e = new AscCommon.CKeyboardEvent();
1466 1467 1468
        _e.CtrlKey = true;
        _e.KeyCode = 86;

Oleg.Korshul's avatar
 
Oleg.Korshul committed
1469 1470 1471
		window["AscDesktopEditorButtonMode"] = true;
        this.WordControl.m_oLogicDocument.OnKeyDown(_e);		
		window["AscDesktopEditorButtonMode"] = false;
1472 1473 1474

        return;
    }
1475
    if (false === this.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Drawing_Props))
Oleg.Korshul's avatar
Oleg.Korshul committed
1476
    {
1477
        if (!window.GlobalPasteFlag)
Oleg.Korshul's avatar
Oleg.Korshul committed
1478
        {
1479
            if (!AscCommon.AscBrowser.isSafariMacOs)
Oleg.Korshul's avatar
Oleg.Korshul committed
1480 1481
            {
                window.GlobalPasteFlag = true;
1482
                return AscCommon.Editor_Paste_Button(this);
Oleg.Korshul's avatar
Oleg.Korshul committed
1483
            }
1484 1485 1486 1487
            else
            {
                if (0 === window.GlobalPasteFlagCounter)
                {
1488
                  AscCommon.SafariIntervalFocus();
1489
                    window.GlobalPasteFlag = true;
1490
                    return AscCommon.Editor_Paste_Button(this);
1491 1492
                }
            }
Oleg.Korshul's avatar
Oleg.Korshul committed
1493 1494
        }
    }
1495
};
1496 1497
asc_docs_api.prototype.Share = function(){

1498
};
1499

1500 1501
asc_docs_api.prototype.onSaveCallback = function(e) {
  var t = this;
1502
  if (false == e["saveLock"]) {
1503
    if (this.isLongAction()) {
1504 1505
      // Мы не можем в этот момент сохранять, т.к. попали в ситуацию, когда мы залочили сохранение и успели нажать вставку до ответа
      // Нужно снять lock с сохранения
1506 1507 1508
      this.CoAuthoringApi.onUnSaveLock = function() {
        t.canSave = true;
        t.IsUserSave = false;
1509
      };
1510
      this.CoAuthoringApi.unSaveLock();
1511 1512
      return;
    }
1513
    this.sync_StartAction(c_oAscAsyncActionType.Information, c_oAscAsyncAction.Save);
1514

1515
    if (c_oAscCollaborativeMarksShowType.LastChanges === this.CollaborativeMarksShowType) {
1516
      AscCommon.CollaborativeEditing.Clear_CollaborativeMarks();
1517
    }
1518

1519
    // Принимаем чужие изменения
1520
    AscCommon.CollaborativeEditing.Apply_Changes();
1521

1522 1523
    this.CoAuthoringApi.onUnSaveLock = function() {
      t.CoAuthoringApi.onUnSaveLock = null;
1524

1525
      // Выставляем, что документ не модифицирован
1526 1527 1528 1529
      t.CheckChangedDocument();
      t.canSave = true;
      t.IsUserSave = false;
      t.sync_EndAction(c_oAscAsyncActionType.Information, c_oAscAsyncAction.Save);
1530

1531
      // Обновляем состояние возможности сохранения документа
1532
      t._onUpdateDocumentCanSave();
1533

1534 1535 1536 1537
      if (undefined !== window["AscDesktopEditor"]) {
        window["AscDesktopEditor"]["OnSave"]();
      }
    };
1538 1539 1540 1541 1542 1543
    var CursorInfo = null;
    if (true === AscCommon.CollaborativeEditing.Is_Fast()) {
      CursorInfo = History.Get_DocumentPositionBinary();
    }
    // Пересылаем свои изменения
    AscCommon.CollaborativeEditing.Send_Changes(this.IsUserSave, {UserId: this.CoAuthoringApi.getUserConnectionId(), UserShortId : this.DocInfo.get_UserId(), CursorInfo: CursorInfo});
1544
  } else {
1545
    var nState = this.CoAuthoringApi.get_state();
1546
    if (AscCommon.ConnectionState.ClosedCoAuth === nState || AscCommon.ConnectionState.ClosedAll === nState) {
1547
      // Отключаемся от сохранения, соединение потеряно
1548 1549
      this.canSave = true;
      this.IsUserSave = false;
1550
    } else {
1551
      var TimeoutInterval = (true === AscCommon.CollaborativeEditing.Is_Fast() ? 1 : 1000);
1552
      setTimeout(function() {
1553 1554 1555
        t.CoAuthoringApi.askSaveChanges(function(event) {
          t.onSaveCallback(event);
        });
1556
      }, TimeoutInterval);
1557
    }
1558
  }
1559
};
1560 1561 1562

asc_docs_api.prototype.asc_Save = function(isAutoSave) {
  this.IsUserSave = !isAutoSave;
1563
  if (true === this.canSave && !this.isLongAction()) {
1564
    this.canSave = false;
1565 1566 1567 1568 1569

    var t = this;
    this.CoAuthoringApi.askSaveChanges(function(e) {
      t.onSaveCallback(e);
    });
1570
  }
1571
};
1572
asc_docs_api.prototype.asc_DownloadAs = function(typeFile, bIsDownloadEvent){//передаем число соответствующее своему формату.
1573
	var options = {downloadType: bIsDownloadEvent ? DownloadType.Download: DownloadType.None};
1574
	this._downloadAs(typeFile, c_oAscAsyncAction.DownloadAs, options);
1575
};
1576 1577 1578 1579
asc_docs_api.prototype.Resize = function(){
	if (false === this.bInit_word_control)
		return;
	this.WordControl.OnResize(false);
1580
};
1581 1582
asc_docs_api.prototype.AddURL = function(url){

1583
};
1584 1585
asc_docs_api.prototype.Help = function(){

1586
};
1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600
asc_docs_api.prototype.startGetDocInfo = function(){
	/*
	Возвращаем объект следующего вида:
	{
		PageCount: 12,
		WordsCount: 2321,
		ParagraphCount: 45,
		SymbolsCount: 232345,
		SymbolsWSCount: 34356
	}
	*/
	this.sync_GetDocInfoStartCallback();

    this.WordControl.m_oLogicDocument.Statistics_Start();
1601
};
1602 1603 1604
asc_docs_api.prototype.stopGetDocInfo = function(){
    this.sync_GetDocInfoStopCallback();
    this.WordControl.m_oLogicDocument.Statistics_Stop();
1605
};
1606 1607
asc_docs_api.prototype.sync_DocInfoCallback = function(obj){
	this.asc_fireCallback( "asc_onDocInfo", new CDocInfoProp(obj));
1608
};
1609 1610
asc_docs_api.prototype.sync_GetDocInfoStartCallback = function(){
	this.asc_fireCallback("asc_onGetDocInfoStart");
1611
};
1612 1613
asc_docs_api.prototype.sync_GetDocInfoStopCallback = function(){
	this.asc_fireCallback("asc_onGetDocInfoStop");
1614
};
1615 1616
asc_docs_api.prototype.sync_GetDocInfoEndCallback = function(){
	this.asc_fireCallback("asc_onGetDocInfoEnd");
1617
};
1618 1619
asc_docs_api.prototype.sync_CanUndoCallback = function(bCanUndo)
{
1620
    if (true === AscCommon.CollaborativeEditing.Is_Fast() && true !== AscCommon.CollaborativeEditing.Is_SingleUser())
1621 1622
        bCanUndo = false;

1623
    this.asc_fireCallback("asc_onCanUndo", bCanUndo);
1624
};
1625 1626
asc_docs_api.prototype.sync_CanRedoCallback = function(bCanRedo)
{
1627
    if (true === AscCommon.CollaborativeEditing.Is_Fast() && true !== AscCommon.CollaborativeEditing.Is_SingleUser())
1628 1629
        bCanRedo = false;

1630
    this.asc_fireCallback("asc_onCanRedo", bCanRedo);
1631
};
1632 1633 1634 1635 1636 1637 1638 1639


/*callbacks*/
/*asc_docs_api.prototype.sync_CursorLockCallBack = function(isLock){
	this.asc_fireCallback("asc_onCursorLock",isLock);
}*/
asc_docs_api.prototype.sync_UndoCallBack = function(){
	this.asc_fireCallback("asc_onUndo");
1640
};
1641 1642
asc_docs_api.prototype.sync_RedoCallBack = function(){
	this.asc_fireCallback("asc_onRedo");
1643
};
1644 1645
asc_docs_api.prototype.sync_CopyCallBack = function(){
	this.asc_fireCallback("asc_onCopy");
1646
};
1647 1648
asc_docs_api.prototype.sync_CutCallBack = function(){
	this.asc_fireCallback("asc_onCut");
1649
};
1650 1651
asc_docs_api.prototype.sync_PasteCallBack = function(){
	this.asc_fireCallback("asc_onPaste");
1652
};
1653 1654
asc_docs_api.prototype.sync_ShareCallBack = function(){
	this.asc_fireCallback("asc_onShare");
1655
};
1656 1657
asc_docs_api.prototype.sync_SaveCallBack = function(){
	this.asc_fireCallback("asc_onSave");
1658
};
1659 1660
asc_docs_api.prototype.sync_DownloadAsCallBack = function(){
	this.asc_fireCallback("asc_onDownload");
1661
};
Oleg.Korshul's avatar
Oleg.Korshul committed
1662

1663 1664
asc_docs_api.prototype.sync_AddURLCallback = function(){
	this.asc_fireCallback("asc_onAddURL");
1665
};
1666 1667
asc_docs_api.prototype.sync_ErrorCallback = function(errorID,errorLevel){
	this.asc_fireCallback("asc_onError",errorID,errorLevel);
1668
};
1669 1670
asc_docs_api.prototype.sync_HelpCallback = function(url){
	this.asc_fireCallback("asc_onHelp",url);
1671
};
1672 1673
asc_docs_api.prototype.sync_UpdateZoom = function(zoom){
	this.asc_fireCallback("asc_onZoom", zoom);
1674
};
1675 1676 1677
asc_docs_api.prototype.ClearPropObjCallback = function(prop){//колбэк предшествующий приходу свойств объекта, prop а всякий случай

	this.asc_fireCallback("asc_onClearPropObj", prop);
1678
};
1679 1680 1681 1682


asc_docs_api.prototype.CollectHeaders = function(){
	this.sync_ReturnHeadersCallback(_fakeHeaders);
1683
};
1684 1685
asc_docs_api.prototype.GetActiveHeader = function(){
	
1686
};
1687 1688
asc_docs_api.prototype.gotoHeader = function(page, X, Y){
	this.goToPage(page);
1689
};
1690 1691
asc_docs_api.prototype.sync_ChangeActiveHeaderCallback = function (position, header){
	this.asc_fireCallback("asc_onChangeActiveHeader", position, new CHeader (header));
1692
};
1693
asc_docs_api.prototype.sync_ReturnHeadersCallback = function (headers){
Alexander.Trofimov's avatar
Alexander.Trofimov committed
1694
	var _headers = [];
1695 1696 1697 1698 1699 1700
	for (var i = 0; i < headers.length; i++)
	{	
		_headers[i] = new CHeader (headers[i]);
	}
	
	this.asc_fireCallback("asc_onReturnHeaders", _headers);
1701
};
1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720
/*----------------------------------------------------------------*/
/*functions for working with search*/
/*
	структура поиска, предварительно, выглядит так
	{
		text: "...<b>слово поиска</b>...",
		pageNumber: 0, //содержит номер страницы, где находится искомая последовательность
		X: 0,//координаты по OX начала последовательности на данной страницы
		Y: 0//координаты по OY начала последовательности на данной страницы
	}
*/
asc_docs_api.prototype.startSearchText = function(what){// "what" means word(s) what we search
	this._searchCur = 0;
	this.sync_SearchStartCallback();

    if (null != this.WordControl.m_oLogicDocument)
        this.WordControl.m_oLogicDocument.Search_Start(what);
    else
        this.WordControl.m_oDrawingDocument.m_oDocumentRenderer.StartSearch(what);
1721
};
1722 1723 1724 1725

asc_docs_api.prototype.goToNextSearchResult = function()
{
    this.WordControl.m_oLogicDocument.goToNextSearchResult();
1726
};
1727 1728 1729 1730 1731 1732


asc_docs_api.prototype.gotoSearchResultText = function(navigator){//переход к результату.

    this.WordControl.m_oDrawingDocument.CurrentSearchNavi = navigator;
    this.WordControl.ToSearchResult();
1733
};
1734 1735 1736 1737
asc_docs_api.prototype.stopSearchText = function(){
	this.sync_SearchStopCallback();

    this.WordControl.m_oLogicDocument.Search_Stop();
1738
};
1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750
asc_docs_api.prototype.findText = function(text, isNext){

    var SearchEngine = editor.WordControl.m_oLogicDocument.Search(text, {MatchCase: false});

    var Id = this.WordControl.m_oLogicDocument.Search_GetId( isNext );

    if ( null != Id )
        this.WordControl.m_oLogicDocument.Search_Select( Id );

    return SearchEngine.Count;

    //return this.WordControl.m_oLogicDocument.findText(text, scanForward);
1751
};
1752

1753 1754 1755
asc_docs_api.prototype.asc_searchEnabled = function(bIsEnabled)
{
    // пустой метод
1756
};
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
1757 1758 1759 1760

asc_docs_api.prototype.asc_findText = function(text, isNext, isMatchCase)
{
    return this.WordControl.m_oLogicDocument.findText(text, isNext === true);
1761
};
1762 1763 1764
// returns: CSearchResult
asc_docs_api.prototype.sync_SearchFoundCallback = function(obj){
	this.asc_fireCallback("asc_onSearchFound", new CSearchResult(obj));
1765
};
1766 1767
asc_docs_api.prototype.sync_SearchStartCallback = function(){
	this.asc_fireCallback("asc_onSearchStart");
1768
};
1769 1770
asc_docs_api.prototype.sync_SearchStopCallback = function(){
	this.asc_fireCallback("asc_onSearchStop");
1771
};
1772 1773
asc_docs_api.prototype.sync_SearchEndCallback = function(){
	this.asc_fireCallback("asc_onSearchEnd");
1774
};
1775 1776 1777 1778 1779
/*----------------------------------------------------------------*/
/*functions for working with font*/
/*setters*/
asc_docs_api.prototype.put_TextPrFontName = function(name)
{
1780
	var loader = AscCommon.g_font_loader;
1781
    var fontinfo = AscFonts.g_fontApplication.GetFontInfo(name);
1782 1783 1784
	var isasync = loader.LoadFont(fontinfo);
	if (false === isasync)
    {
1785
        if(editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Drawing_Props) === false) {
1786
            History.Create_NewPoint(AscDFH.historydescription_Presentation_ParagraphAdd);
1787
            this.WordControl.m_oLogicDocument.Paragraph_Add(new AscCommonWord.ParaTextPr({
1788
                FontFamily: {
1789
                    Name: name,
1790 1791 1792 1793
                    Index: -1
                }
            }));
        }
1794
    }
1795
};
1796 1797
asc_docs_api.prototype.put_TextPrFontSize = function(size)
{
1798
    if(editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Drawing_Props) === false) {
1799
        History.Create_NewPoint(AscDFH.historydescription_Presentation_ParagraphAdd);
1800
        this.WordControl.m_oLogicDocument.Paragraph_Add(new AscCommonWord.ParaTextPr({FontSize: Math.min(size, 100)}));
1801
    }
1802
};
1803 1804
asc_docs_api.prototype.put_TextPrBold = function(value)
{
1805
    if(editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Drawing_Props) === false) {
1806
        History.Create_NewPoint(AscDFH.historydescription_Presentation_ParagraphAdd);
1807
        this.WordControl.m_oLogicDocument.Paragraph_Add(new AscCommonWord.ParaTextPr({Bold: value}));
1808
    }
1809
};
1810 1811
asc_docs_api.prototype.put_TextPrItalic = function(value)
{
1812
    if(editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Drawing_Props) === false) {
1813
        History.Create_NewPoint(AscDFH.historydescription_Presentation_ParagraphAdd);
1814
        this.WordControl.m_oLogicDocument.Paragraph_Add(new AscCommonWord.ParaTextPr({Italic: value}));
1815
    }
1816
};
1817 1818
asc_docs_api.prototype.put_TextPrUnderline = function(value)
{
1819
    if(editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Drawing_Props) === false) {
1820
        History.Create_NewPoint(AscDFH.historydescription_Presentation_ParagraphAdd);
1821
        this.WordControl.m_oLogicDocument.Paragraph_Add(new AscCommonWord.ParaTextPr({Underline: value}));
1822
    }
1823
};
1824 1825
asc_docs_api.prototype.put_TextPrStrikeout = function(value)
{
1826
    if(editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Drawing_Props) === false) {
1827
        History.Create_NewPoint(AscDFH.historydescription_Presentation_ParagraphAdd);
1828
        this.WordControl.m_oLogicDocument.Paragraph_Add(new AscCommonWord.ParaTextPr({Strikeout: value}));
1829
    }
1830
};
1831 1832 1833
asc_docs_api.prototype.put_PrLineSpacing = function(Type, Value)
{
	this.WordControl.m_oLogicDocument.Set_ParagraphSpacing( { LineRule : Type,  Line : Value } );
1834
};
1835 1836 1837 1838 1839 1840 1841 1842 1843
asc_docs_api.prototype.put_LineSpacingBeforeAfter = function(type,value)//"type == 0" means "Before", "type == 1" means "After"
{
	switch (type)
    {
		case 0:
			this.WordControl.m_oLogicDocument.Set_ParagraphSpacing( {Before : value}); break;
		case 1:
			this.WordControl.m_oLogicDocument.Set_ParagraphSpacing( {After : value}); break;
	}
1844
};
1845 1846 1847
asc_docs_api.prototype.FontSizeIn = function()
{
    this.WordControl.m_oLogicDocument.Paragraph_IncDecFontSize(true);
1848
};
1849 1850 1851
asc_docs_api.prototype.FontSizeOut = function()
{
    this.WordControl.m_oLogicDocument.Paragraph_IncDecFontSize(false);
1852
};
1853

1854 1855 1856
asc_docs_api.prototype.put_AlignBySelect = function(val)
{
    this.bAlignBySelected = val;
1857
};
1858

Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
1859 1860 1861
asc_docs_api.prototype.get_AlignBySelect = function()
{
    return this.bAlignBySelected;
1862
};
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
1863

1864 1865 1866
/*callbacks*/
asc_docs_api.prototype.sync_BoldCallBack = function(isBold){
	this.asc_fireCallback("asc_onBold",isBold);
1867
};
1868 1869
asc_docs_api.prototype.sync_ItalicCallBack = function(isItalic){
	this.asc_fireCallback("asc_onItalic",isItalic);
1870
};
1871 1872
asc_docs_api.prototype.sync_UnderlineCallBack = function(isUnderline){
	this.asc_fireCallback("asc_onUnderline",isUnderline);
1873
};
1874 1875
asc_docs_api.prototype.sync_StrikeoutCallBack = function(isStrikeout){
	this.asc_fireCallback("asc_onStrikeout",isStrikeout);
1876
};
1877
asc_docs_api.prototype.sync_TextPrFontFamilyCallBack = function(FontFamily){
1878
	this.asc_fireCallback("asc_onFontFamily", new AscCommon.asc_CTextFontFamily( FontFamily ));
1879
};
1880
asc_docs_api.prototype.sync_TextPrFontSizeCallBack = function(FontSize){
1881
	this.asc_fireCallback("asc_onFontSize", FontSize);
1882
};
1883
asc_docs_api.prototype.sync_PrLineSpacingCallBack = function(LineSpacing){
1884
	this.asc_fireCallback("asc_onLineSpacing", new AscCommon.asc_CParagraphSpacing ( LineSpacing ) );
1885
};
1886 1887 1888 1889

asc_docs_api.prototype.sync_InitEditorThemes = function(gui_editor_themes, gui_document_themes){
    this._gui_editor_themes = gui_editor_themes;
    this._gui_document_themes = gui_document_themes;
1890
    this.asc_fireCallback("asc_onInitEditorStyles", [gui_editor_themes, gui_document_themes]);
1891
};
1892 1893
asc_docs_api.prototype.sync_InitEditorTableStyles = function(styles){
    this.asc_fireCallback("asc_onInitTableTemplates",styles);
1894 1895
};

1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921
/*----------------------------------------------------------------*/
/*functions for working with paragraph*/
/*setters*/
// Right = 0; Left = 1; Center = 2; Justify = 3; or using enum that written above

/* структура для параграфа
	Ind :
   	{
       	Left      : 0,                    // Левый отступ
       	Right     : 0,                    // Правый отступ
     	FirstLine : 0                     // Первая строка
   	}
   	Spacing :
   	{
       	Line     : 1.15,                  // Расстояние между строками внутри абзаца
       	LineRule : linerule_Auto,         // Тип расстрояния между строками
       	Before   : 0,                     // Дополнительное расстояние до абзаца
       	After    : 10 * g_dKoef_pt_to_mm  // Дополнительное расстояние после абзаца
   	},
   	KeepLines : false,                    // переносить параграф на новую страницу,
                                         // если на текущей он целиком не убирается
   	PageBreakBefore : false
*/

asc_docs_api.prototype.paraApply = function(Props)
{
1922 1923 1924 1925 1926
        var _presentation = editor.WordControl.m_oLogicDocument;
        if(_presentation.Slides[_presentation.CurPage])
        {
            var graphicObjects = _presentation.Slides[_presentation.CurPage].graphicObjects;
            graphicObjects.checkSelectedObjectsAndCallback(function(){
1927

1928 1929
                if ( "undefined" != typeof(Props.Ind) && null != Props.Ind )
                    graphicObjects.setParagraphIndent( Props.Ind );
1930

1931 1932
                if ( "undefined" != typeof(Props.Jc) && null != Props.Jc )
                    graphicObjects.setParagraphAlign( Props.Jc );
1933

Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
1934

1935 1936
                if ( "undefined" != typeof(Props.Spacing) && null != Props.Spacing )
                    graphicObjects.setParagraphSpacing( Props.Spacing );
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
1937 1938


1939 1940
                if ( undefined != Props.Tabs )
                {
Alexander.Trofimov's avatar
Alexander.Trofimov committed
1941
                    var Tabs = new AscCommonWord.CParaTabs();
1942 1943 1944
                    Tabs.Set_FromObject( Props.Tabs.Tabs );
                    graphicObjects.setParagraphTabs( Tabs );
                }
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
1945

1946 1947 1948 1949
                if ( undefined != Props.DefaultTab )
                {
                    _presentation.Set_DocumentDefaultTab( Props.DefaultTab );
                }
Alexander.Trofimov's avatar
Alexander.Trofimov committed
1950
                var TextPr = new AscCommonWord.CTextPr();
1951

1952
                if ( true === Props.Subscript )
1953
                    TextPr.VertAlign = AscCommon.vertalign_SubScript;
1954
                else if ( true === Props.Superscript )
1955
                    TextPr.VertAlign = AscCommon.vertalign_SuperScript;
1956
                else if ( false === Props.Superscript || false === Props.Subscript )
1957
                    TextPr.VertAlign = AscCommon.vertalign_Baseline;
1958

1959 1960 1961 1962 1963
                if ( undefined != Props.Strikeout )
                {
                    TextPr.Strikeout  = Props.Strikeout;
                    TextPr.DStrikeout = false;
                }
1964

1965 1966 1967 1968 1969 1970
                if ( undefined != Props.DStrikeout )
                {
                    TextPr.DStrikeout = Props.DStrikeout;
                    if ( true === TextPr.DStrikeout )
                        TextPr.Strikeout = false;
                }
1971

1972 1973 1974 1975 1976
                if ( undefined != Props.SmallCaps )
                {
                    TextPr.SmallCaps = Props.SmallCaps;
                    TextPr.AllCaps   = false;
                }
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
1977

1978 1979 1980 1981 1982 1983
                if ( undefined != Props.AllCaps )
                {
                    TextPr.Caps = Props.AllCaps;
                    if ( true === TextPr.AllCaps )
                        TextPr.SmallCaps = false;
                }
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
1984

1985 1986
                if ( undefined != Props.TextSpacing )
                    TextPr.Spacing = Props.TextSpacing;
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
1987

1988 1989
                if ( undefined != Props.Position )
                    TextPr.Position = Props.Position;
1990
                graphicObjects.paragraphAdd( new AscCommonWord.ParaTextPr(TextPr) );
1991 1992
                _presentation.Recalculate();
                _presentation.Document_UpdateInterfaceState();
1993
            }, [], false, AscDFH.historydescription_Presentation_ParaApply);
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
1994
        }
1995
};
1996 1997 1998

asc_docs_api.prototype.put_PrAlign = function(value)
{
1999
    this.WordControl.m_oLogicDocument.Create_NewHistoryPoint(AscDFH.historydescription_Presentation_PutTextPrAlign);
2000
	this.WordControl.m_oLogicDocument.Set_ParagraphAlign(value);
2001
};
2002 2003 2004
// 0- baseline, 2-subscript, 1-superscript
asc_docs_api.prototype.put_TextPrBaseline = function(value)
{
2005
    if(editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Drawing_Props) === false) {
2006
        History.Create_NewPoint(AscDFH.historydescription_Presentation_ParagraphAdd);
2007
        this.WordControl.m_oLogicDocument.Paragraph_Add(new AscCommonWord.ParaTextPr({VertAlign: value}));
2008
    }
2009
};
2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045
/* 	Маркированный список Type = 0
		нет         - SubType = -1
		черная точка - SubType = 1
		круг         - SubType = 2
		квадрат      - SubType = 3
		картинка     - SubType = -1
		4 ромба      - SubType = 4
		ч/б стрелка  - SubType = 5
		галка        - SubType = 6
	
	Нумерованный список Type = 1
		нет - SubType = -1
		1.  - SubType = 1
		1)  - SubType = 2
		I.  - SubType = 3
		A.  - SubType = 4
		a)  - SubType = 5
		a.  - SubType = 6
		i.  - SubType = 7
	
	Многоуровневый список Type = 2
		нет            - SubType = -1
		1)a)i)        - SubType = 1
		1.1.1         - SubType = 2
		маркированный - SubType = 3 
*/
asc_docs_api.prototype.put_ListType = function(type, subtype)
{
	var NumberInfo =
	{
		Type    : 0,
		SubType : -1
	};

	NumberInfo.Type = type;
	NumberInfo.SubType = subtype;
2046
    this.WordControl.m_oLogicDocument.Create_NewHistoryPoint(AscDFH.historydescription_Presentation_PutTextPrListType);
2047
	this.WordControl.m_oLogicDocument.Set_ParagraphNumbering( NumberInfo );
2048
};
2049 2050 2051 2052

asc_docs_api.prototype.put_ShowSnapLines = function(isShow)
{
    this.ShowSnapLines = isShow;
2053
};
2054 2055 2056
asc_docs_api.prototype.get_ShowSnapLines = function()
{
    return this.ShowSnapLines;
Alexander.Trofimov's avatar
Alexander.Trofimov committed
2057
};
2058

2059 2060 2061 2062
asc_docs_api.prototype.put_ShowParaMarks = function(isShow){
	this.ShowParaMarks = isShow;
	this.WordControl.OnRePaintAttack();
	return this.ShowParaMarks;
2063
};
2064 2065
asc_docs_api.prototype.get_ShowParaMarks = function(){
    return this.ShowParaMarks;
2066
};
2067 2068 2069 2070 2071 2072
asc_docs_api.prototype.put_ShowTableEmptyLine = function(isShow)
{
    this.isShowTableEmptyLine = isShow;
    this.WordControl.OnRePaintAttack();

    return this.isShowTableEmptyLine;
2073
};
2074 2075
asc_docs_api.prototype.get_ShowTableEmptyLine = function(){
    return this.isShowTableEmptyLine;
2076
};
2077 2078 2079 2080 2081

asc_docs_api.prototype.ShapeApply = function(prop)
{
    // нужно определить, картинка это или нет
    var image_url = "";
2082 2083
    prop.Width = prop.w;
    prop.Height = prop.h;
2084 2085

    var bShapeTexture = true;
2086 2087 2088 2089
    if (prop.fill != null)
    {
        if (prop.fill.fill != null && prop.fill.type == c_oAscFill.FILL_TYPE_BLIP)
        {
2090
            image_url = prop.fill.fill.asc_getUrl();
2091

2092
            var _tx_id = prop.fill.fill.asc_getTextureId();
2093
            if (null != _tx_id && 0 <= _tx_id && _tx_id < AscCommon.g_oUserTexturePresets.length)
2094
            {
2095
                image_url = AscCommon.g_oUserTexturePresets[_tx_id];
2096 2097 2098
            }
        }
    }
2099 2100 2101 2102
    var oFill;
    if(prop.textArtProperties)
    {
        oFill = prop.textArtProperties.asc_getFill();
2103
        if (oFill && oFill.fill != null && oFill.type == c_oAscFill.FILL_TYPE_BLIP)
2104 2105 2106 2107
        {
            image_url = oFill.fill.asc_getUrl();

            var _tx_id = oFill.fill.asc_getTextureId();
2108
            if (null != _tx_id && 0 <= _tx_id && _tx_id < AscCommon.g_oUserTexturePresets.length)
2109
            {
2110
                image_url = AscCommon.g_oUserTexturePresets[_tx_id];
2111 2112 2113 2114
            }
            bShapeTexture = false;
        }
    }
2115
    if (!AscCommon.isNullOrEmptyString(image_url)){
2116 2117 2118
        var sImageUrl = null;
        if(!g_oDocumentUrls.getImageLocal(image_url)){
          sImageUrl = image_url;
2119
        }
2120 2121 2122 2123 2124 2125 2126 2127 2128
      var oApi = this;
        var fApplyCallback = function(){
          var _image = oApi.ImageLoader.LoadImage(image_url, 1);
          var srcLocal = g_oDocumentUrls.getImageLocal(image_url);
          if (srcLocal) {
            image_url = srcLocal;
          }
          if(bShapeTexture)
          {
2129
            prop.fill.fill.asc_putUrl(image_url); // erase documentUrl
2130 2131 2132
          }
          else
          {
2133
            oFill.fill.asc_putUrl(image_url);
2134 2135 2136 2137
          }
          if (null != _image)
          {
            oApi.WordControl.m_oLogicDocument.ShapeApply(prop);
2138 2139
            if(bShapeTexture)
            {
2140
              oApi.WordControl.m_oDrawingDocument.DrawImageTextureFillShape(image_url);
2141 2142 2143
            }
            else
            {
2144
              oApi.WordControl.m_oDrawingDocument.DrawImageTextureFillTextArt(image_url);
2145
            }
2146 2147 2148 2149
          }
          else
          {
            oApi.sync_StartAction(c_oAscAsyncActionType.Information, c_oAscAsyncAction.LoadImage);
2150
            var oProp = prop;
2151
            oApi.asyncImageEndLoaded2 = function(_image)
2152
            {
2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163
              oApi.WordControl.m_oLogicDocument.ShapeApply(oProp);
              oApi.WordControl.m_oDrawingDocument.DrawImageTextureFillShape(image_url);
              oApi.sync_EndAction(c_oAscAsyncActionType.Information, c_oAscAsyncAction.LoadImage);
              oApi.asyncImageEndLoaded2 = null;
            }
          }
        };
        if(!sImageUrl){
          fApplyCallback();
        }
        else{
2164 2165 2166 2167 2168 2169 2170 2171 2172

          if (window["AscDesktopEditor"])
          {
              image_url = window["AscDesktopEditor"]["LocalFileGetImageUrl"](sImageUrl);
			  image_url = g_oDocumentUrls.getImageUrl(image_url);
              fApplyCallback();
              return;
          }

2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193
          this.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage);
          this.fCurCallback = function(input) {
            if(null != input && "imgurl" == input["type"]){
              if("ok" ==input["status"]) {
                var data = input["data"];
                var urls = {};
                var firstUrl;
                for(var i = 0; i < data.length; ++i){
                  var elem = data[i];
                  if(elem.url){
                    if(!firstUrl){
                      firstUrl = elem.url;
                    }
                    urls[elem.path] = elem.url;
                  }
                }
                g_oDocumentUrls.addUrls(urls);
                if(firstUrl) {
                  image_url = firstUrl;
                  fApplyCallback();
                } else {
2194
                  oApi.asc_fireCallback("asc_onError",c_oAscError.ID.Unknown,c_oAscError.Level.NoCritical);
2195 2196
                }
              } else {
2197
                oApi.asc_fireCallback("asc_onError", mapAscServerErrorToAscError(parseInt(input["data"])), c_oAscError.Level.NoCritical);
2198 2199
              }
            } else {
2200
              oApi.asc_fireCallback("asc_onError",c_oAscError.ID.Unknown,c_oAscError.Level.NoCritical);
2201
            }
2202 2203 2204
            oApi.sync_EndAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage);
          };
          var rData = {
Alexander.Trofimov's avatar
Alexander.Trofimov committed
2205
            "id":this.documentId,
2206
            "userid": this.documentUserId,
2207
            "vkey": this.documentVKey,
2208 2209 2210
            "c":"imgurl",
            "saveindex": g_oDocumentUrls.getMaxIndex(),
            "data": sImageUrl};
2211
          sendCommand(this, null, rData );
2212 2213 2214 2215
        }
    }
    else
    {
2216
        if(!this.noCreatePoint || this.exucuteHistory)
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
2217
        {
2218
            if(!this.noCreatePoint && !this.exucuteHistory && this.exucuteHistoryEnd)
2219
            {
2220 2221 2222 2223 2224
                if(-1 !== this.nCurPointItemsLength)
                {
                    History.UndoLastPoint();
                    var slide = this.WordControl.m_oLogicDocument.Slides[this.WordControl.m_oLogicDocument.CurPage];
                    slide.graphicObjects.applyDrawingProps(prop);
2225
                    this.WordControl.m_oLogicDocument.Recalculate();
2226 2227 2228 2229 2230 2231 2232
                    this.WordControl.m_oDrawingDocument.OnRecalculatePage(this.WordControl.m_oLogicDocument.CurPage, slide);
                    this.WordControl.m_oDrawingDocument.OnEndRecalculate();
                }
                else
                {
                    this.WordControl.m_oLogicDocument.ShapeApply(prop);
                }
2233
                this.exucuteHistoryEnd = false;
2234
                this.nCurPointItemsLength = -1;
2235 2236 2237 2238 2239 2240 2241
            }
            else
            {
                this.WordControl.m_oLogicDocument.ShapeApply(prop);
            }
            if(this.exucuteHistory)
            {
2242 2243 2244 2245 2246
                var oPoint = History.Points[History.Index];
                if(oPoint)
                {
                    this.nCurPointItemsLength = oPoint.Items.length;
                }
2247 2248 2249 2250
                else
                {
                    this.nCurPointItemsLength = -1;
                }
2251 2252
                this.exucuteHistory = false;
            }
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
2253 2254 2255
        }
        else
        {
2256 2257
            if(this.WordControl.m_oLogicDocument.Slides[this.WordControl.m_oLogicDocument.CurPage])
            {
2258 2259 2260 2261 2262
                if(-1 !== this.nCurPointItemsLength)
                {
                    History.UndoLastPoint();
                    var slide = this.WordControl.m_oLogicDocument.Slides[this.WordControl.m_oLogicDocument.CurPage];
                    slide.graphicObjects.applyDrawingProps(prop);
2263
                    this.WordControl.m_oLogicDocument.Recalculate();
2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279
                    this.WordControl.m_oDrawingDocument.OnRecalculatePage(this.WordControl.m_oLogicDocument.CurPage, slide);
                    this.WordControl.m_oDrawingDocument.OnEndRecalculate();
                }
                else
                {
                    this.WordControl.m_oLogicDocument.ShapeApply(prop);
                    var oPoint = History.Points[History.Index];
                    if(oPoint)
                    {
                        this.nCurPointItemsLength = oPoint.Items.length;
                    }
                    else
                    {
                        this.nCurPointItemsLength = -1;
                    }
                }
2280
            }
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
2281
        }
2282
    }
2283
};
2284

2285 2286 2287
asc_docs_api.prototype.setStartPointHistory = function(){
    this.noCreatePoint = true;
    this.exucuteHistory = true;
2288
    this.incrementCounterLongAction();
2289 2290 2291 2292
};
asc_docs_api.prototype.setEndPointHistory   = function(){
    this.noCreatePoint = false;
    this.exucuteHistoryEnd = true;
2293
    this.decrementCounterLongAction();
2294
};
2295 2296 2297 2298 2299 2300 2301 2302
asc_docs_api.prototype.SetSlideProps = function(prop)
{
    if (null == prop)
        return;

    var arr_ind = this.WordControl.Thumbnails.GetSelectedArray();
    var _back_fill = prop.get_background();

Oleg.Korshul's avatar
Oleg.Korshul committed
2303
    if (_back_fill)
2304
    {
2305
        if (_back_fill.asc_getType() == c_oAscFill.FILL_TYPE_NOFILL)
Oleg.Korshul's avatar
Oleg.Korshul committed
2306
        {
2307 2308 2309
            var bg = new AscFormat.CBg();
            bg.bgPr = new AscFormat.CBgPr();
            bg.bgPr.Fill = AscFormat.CorrectUniFill(_back_fill, null);
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
2310 2311

            this.WordControl.m_oLogicDocument.changeBackground(bg, arr_ind);
Oleg.Korshul's avatar
Oleg.Korshul committed
2312 2313
            return;
        }
2314

2315
        var _old_fill = this.WordControl.m_oLogicDocument.Slides[this.WordControl.m_oLogicDocument.CurPage].backgroundFill;
2316
        if (AscCommon.isRealObject(_old_fill))
2317
            _old_fill = _old_fill.createDuplicate();
2318 2319 2320
        var bg = new AscFormat.CBg();
        bg.bgPr = new AscFormat.CBgPr();
        bg.bgPr.Fill = AscFormat.CorrectUniFill(_back_fill, _old_fill);
Oleg.Korshul's avatar
Oleg.Korshul committed
2321
        var image_url = "";
2322
        if (_back_fill.asc_getType() == c_oAscFill.FILL_TYPE_BLIP && _back_fill.fill && typeof _back_fill.fill.url === "string" && _back_fill.fill.url.length > 0)
2323
        {
2324
            image_url = _back_fill.fill.url;
2325
        }
2326
        if (image_url != "")
2327
        {
Oleg.Korshul's avatar
Oleg.Korshul committed
2328
            var _image = this.ImageLoader.LoadImage(image_url, 1);
2329 2330 2331
            var srcLocal = g_oDocumentUrls.getImageLocal(image_url);
            if (srcLocal) {
                image_url = srcLocal;
Oleg.Korshul's avatar
Oleg.Korshul committed
2332
                bg.bgPr.Fill.fill.RasterImageId = image_url; // erase documentUrl
2333 2334
            }

Oleg.Korshul's avatar
Oleg.Korshul committed
2335
            if (null != _image)
2336 2337 2338 2339 2340 2341 2342
            {
                if (bg.bgPr.Fill != null && bg.bgPr.Fill.fill != null && bg.bgPr.Fill.fill.type == c_oAscFill.FILL_TYPE_BLIP)
                {
                    this.WordControl.m_oDrawingDocument.DrawImageTextureFillSlide(bg.bgPr.Fill.fill.RasterImageId);
                }

                this.WordControl.m_oLogicDocument.changeBackground(bg, arr_ind);
Oleg.Korshul's avatar
Oleg.Korshul committed
2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357
            }
            else
            {
                this.sync_StartAction(c_oAscAsyncActionType.Information, c_oAscAsyncAction.LoadImage);

                var oProp = prop;
                this.asyncImageEndLoaded2 = function(_image)
                {
                    if (bg.bgPr.Fill != null && bg.bgPr.Fill.fill != null && bg.bgPr.Fill.fill.type == c_oAscFill.FILL_TYPE_BLIP)
                    {
                        this.WordControl.m_oDrawingDocument.DrawImageTextureFillSlide(bg.bgPr.Fill.fill.RasterImageId);
                    }

                    this.WordControl.m_oLogicDocument.changeBackground(bg, arr_ind);
                    this.asyncImageEndLoaded2 = null;
Oleg.Korshul's avatar
Oleg.Korshul committed
2358 2359

                    this.sync_EndAction(c_oAscAsyncActionType.Information, c_oAscAsyncAction.LoadImage);
Oleg.Korshul's avatar
Oleg.Korshul committed
2360
                }
2361 2362
            }
        }
Oleg.Korshul's avatar
Oleg.Korshul committed
2363
        else
2364
        {
Oleg.Korshul's avatar
Oleg.Korshul committed
2365 2366 2367 2368
            if (bg.bgPr.Fill != null && bg.bgPr.Fill.fill != null && bg.bgPr.Fill.fill.type == c_oAscFill.FILL_TYPE_BLIP)
            {
                this.WordControl.m_oDrawingDocument.DrawImageTextureFillSlide(bg.bgPr.Fill.fill.RasterImageId);
            }
2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389

            if(!this.noCreatePoint || this.exucuteHistory)
            {
                if( !this.noCreatePoint && !this.exucuteHistory && this.exucuteHistoryEnd)
                {
                    this.WordControl.m_oLogicDocument.changeBackground(bg, arr_ind, true);
                    this.exucuteHistoryEnd = false;
                }
                else
                {
                    this.WordControl.m_oLogicDocument.changeBackground(bg, arr_ind);
                }
                if(this.exucuteHistory)
                {
                    this.exucuteHistory = false;
                }
            }
            else
            {
                if(this.WordControl.m_oLogicDocument.Slides[this.WordControl.m_oLogicDocument.CurPage])
                {
2390
                    AscFormat.ExecuteNoHistory(function(){
2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406

                        this.WordControl.m_oLogicDocument.changeBackground(bg, arr_ind, true);
                        for(var i = 0; i <arr_ind.length; ++i)
                        {
                            this.WordControl.m_oLogicDocument.Slides[arr_ind[i]].recalculateBackground()
                        }
                        for(i = 0; i <arr_ind.length; ++i)
                        {
                            this.WordControl.m_oLogicDocument.DrawingDocument.OnRecalculatePage(arr_ind[i], this.WordControl.m_oLogicDocument.Slides[arr_ind[i]]);
                        }
                        this.WordControl.m_oLogicDocument.DrawingDocument.OnEndRecalculate(true, false);
                    }, this, []);
                }
            }


2407
        }
Oleg.Korshul's avatar
Oleg.Korshul committed
2408 2409 2410 2411 2412 2413
    }

    var _timing = prop.get_timing();
    if (_timing)
    {
        this.ApplySlideTiming(_timing);
2414
    }
2415
};
2416 2417 2418 2419

asc_docs_api.prototype.put_LineCap = function(_cap)
{
    this.WordControl.m_oLogicDocument.putLineCap(_cap);
2420
};
2421 2422 2423
asc_docs_api.prototype.put_LineJoin = function(_join)
{
    this.WordControl.m_oLogicDocument.putLineJoin(_join);
2424
};
2425 2426 2427 2428

asc_docs_api.prototype.put_LineBeginStyle = function(_style)
{
    this.WordControl.m_oLogicDocument.putLineBeginStyle(_style);
2429
};
2430 2431 2432
asc_docs_api.prototype.put_LineBeginSize = function(_size)
{
    this.WordControl.m_oLogicDocument.putLineBeginSize(_size);
2433
};
2434 2435 2436 2437

asc_docs_api.prototype.put_LineEndStyle = function(_style)
{
    this.WordControl.m_oLogicDocument.putLineEndStyle(_style);
2438
};
2439 2440 2441
asc_docs_api.prototype.put_LineEndSize = function(_size)
{
    this.WordControl.m_oLogicDocument.putLineEndSize(_size);
2442
};
2443 2444 2445

asc_docs_api.prototype.put_TextColor2 = function(r, g, b)
{
2446
    if(editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Drawing_Props) === false) {
2447
        History.Create_NewPoint(AscDFH.historydescription_Presentation_ParagraphAdd);
2448
        this.WordControl.m_oLogicDocument.Paragraph_Add(new AscCommonWord.ParaTextPr({Color: {r: r, g: g, b: b}}));
2449
    }
2450
};
2451 2452
asc_docs_api.prototype.put_TextColor = function(color)
{
2453
    if(editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Drawing_Props) === false) {
2454
        History.Create_NewPoint(AscDFH.historydescription_Presentation_ParagraphAdd);
2455 2456 2457
        var _unifill = new AscFormat.CUniFill();
        _unifill.fill = new AscFormat.CSolidFill();
        _unifill.fill.color = AscFormat.CorrectUniColor(color, _unifill.fill.color, 0);
2458
        this.WordControl.m_oLogicDocument.Paragraph_Add(new AscCommonWord.ParaTextPr({Unifill: _unifill}));
2459
    }
2460
};
2461

2462 2463
asc_docs_api.prototype.put_PrIndent = function(value,levelValue)
{
2464
    this.WordControl.m_oLogicDocument.Create_NewHistoryPoint(AscDFH.historydescription_Presentation_PutPrIndent);
2465
	this.WordControl.m_oLogicDocument.Set_ParagraphIndent( { Left : value, ChangeLevel: levelValue } );
2466
};
2467 2468
asc_docs_api.prototype.IncreaseIndent = function()
{
2469
	this.WordControl.m_oLogicDocument.Paragraph_IncDecIndent( true );
2470
};
2471 2472
asc_docs_api.prototype.DecreaseIndent = function()
{
2473
    this.WordControl.m_oLogicDocument.Paragraph_IncDecIndent( false );
2474
};
2475 2476
asc_docs_api.prototype.put_PrIndentRight = function(value)
{
2477
    this.WordControl.m_oLogicDocument.Create_NewHistoryPoint(AscDFH.historydescription_Presentation_PutPrIndentRight);
2478
	this.WordControl.m_oLogicDocument.Set_ParagraphIndent( { Right : value } );
2479
};
2480 2481
asc_docs_api.prototype.put_PrFirstLineIndent = function(value)
{
2482
    this.WordControl.m_oLogicDocument.Create_NewHistoryPoint(AscDFH.historydescription_Presentation_PutPrFirstLineIndent);
2483
	this.WordControl.m_oLogicDocument.Set_ParagraphIndent( { FirstLine : value } );
2484
};
2485 2486
asc_docs_api.prototype.getFocusObject = function(){//возвратит тип элемента - параграф c_oAscTypeSelectElement.Paragraph, изображение c_oAscTypeSelectElement.Image, таблица c_oAscTypeSelectElement.Table, колонтитул c_oAscTypeSelectElement.Header.

2487
};
2488 2489 2490 2491

/*callbacks*/
asc_docs_api.prototype.sync_VerticalAlign = function(typeBaseline){
	this.asc_fireCallback("asc_onVerticalAlign",typeBaseline);
2492
};
2493 2494
asc_docs_api.prototype.sync_PrAlignCallBack = function(value){
	this.asc_fireCallback("asc_onPrAlign",value);
2495
};
2496
asc_docs_api.prototype.sync_ListType = function(NumPr){
2497
	this.asc_fireCallback("asc_onListType", new AscCommon.asc_CListType( NumPr ) );
2498
};
2499
asc_docs_api.prototype.sync_TextColor = function(Color){
2500
	this.asc_fireCallback("asc_onTextColor", new AscCommon.CColor( Color.r, Color.g, Color.b ));
2501
};
2502
asc_docs_api.prototype.sync_TextColor2 = function(unifill)
2503
{
2504
    var _color;
2505 2506
    if (unifill.fill == null)
        return;
2507
    else if (unifill.fill.type == c_oAscFill.FILL_TYPE_SOLID)
2508
    {
2509
        _color = unifill.getRGBAColor();
2510
        var color = AscCommon.CreateAscColor(unifill.fill.color);
2511 2512 2513
        color.asc_putR(_color.R);
        color.asc_putG(_color.G);
        color.asc_putB(_color.B);
2514 2515
        this.asc_fireCallback("asc_onTextColor", color);
    }
2516
    else if (unifill.fill.type == c_oAscFill.FILL_TYPE_GRAD)
2517
    {
2518
        _color = unifill.getRGBAColor();
2519
        var color = AscCommon.CreateAscColor(unifill.fill.colors[0].color);
2520 2521 2522
        color.asc_putR(_color.R);
        color.asc_putG(_color.G);
        color.asc_putB(_color.B);
2523 2524 2525 2526
        this.asc_fireCallback("asc_onTextColor", color);
    }
    else
    {
2527
        _color = unifill.getRGBAColor();
2528
        var color = new Asc.asc_CColor();
2529 2530 2531
        color.asc_putR(_color.R);
        color.asc_putG(_color.G);
        color.asc_putB(_color.B);
2532 2533
        this.asc_fireCallback("asc_onTextColor", color);
    }
2534
};
2535
asc_docs_api.prototype.sync_TextHighLight = function(HighLight){
2536
	this.asc_fireCallback("asc_onTextHighLight", new AscCommon.CColor( HighLight.r, HighLight.g, HighLight.b ) );
2537
};
2538 2539
asc_docs_api.prototype.sync_ParaStyleName = function(Name){
	this.asc_fireCallback("asc_onParaStyleName",Name);
2540
};
2541
asc_docs_api.prototype.sync_ParaSpacingLine = function(SpacingLine){
2542
	this.asc_fireCallback("asc_onParaSpacingLine", new AscCommon.asc_CParagraphSpacing ( SpacingLine ));
2543
};
2544 2545
asc_docs_api.prototype.sync_PageBreakCallback = function(isBreak){
	this.asc_fireCallback("asc_onPageBreak",isBreak);
2546
};
2547 2548
asc_docs_api.prototype.sync_KeepLinesCallback = function(isKeepLines){
	this.asc_fireCallback("asc_onKeepLines",isKeepLines);
2549
};
2550 2551
asc_docs_api.prototype.sync_ShowParaMarksCallback = function(){
	this.asc_fireCallback("asc_onShowParaMarks");
2552
};
2553 2554
asc_docs_api.prototype.sync_SpaceBetweenPrgCallback = function(){
	this.asc_fireCallback("asc_onSpaceBetweenPrg");
2555
};
2556 2557 2558 2559 2560 2561
asc_docs_api.prototype.sync_PrPropCallback = function(prProp){
    var _len = this.SelectedObjectsStack.length;
    if (_len > 0)
    {
        if (this.SelectedObjectsStack[_len - 1].Type == c_oAscTypeSelectElement.Paragraph)
        {
2562
            this.SelectedObjectsStack[_len - 1].Value = new Asc.asc_CParagraphProperty( prProp );
2563 2564 2565 2566
            return;
        }
    }

2567
    this.SelectedObjectsStack[this.SelectedObjectsStack.length] = new asc_CSelectedObject( c_oAscTypeSelectElement.Paragraph, new Asc.asc_CParagraphProperty( prProp ) );
2568
};
2569

Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
2570 2571 2572 2573
asc_docs_api.prototype.SetDrawImagePlaceParagraph = function(element_id, props)
{
    this.WordControl.m_oDrawingDocument.InitGuiCanvasTextProps(element_id);
    this.WordControl.m_oDrawingDocument.DrawGuiCanvasTextProps(props);
2574
};
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
2575

2576 2577 2578 2579 2580
/*----------------------------------------------------------------*/

asc_docs_api.prototype.get_DocumentOrientation = function()
{
	return this.DocumentOrientation;
2581
};
2582 2583

asc_docs_api.prototype.Update_ParaInd = function( Ind ){
Alexander.Trofimov's avatar
Alexander.Trofimov committed
2584 2585 2586
	var FirstLine = 0;
	var Left = 0;
	var Right = 0;
2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605
	if ( "undefined" != typeof(Ind) )
	{
		if("undefined" != typeof(Ind.FirstLine))
		{
			FirstLine = Ind.FirstLine;
		}
		if("undefined" != typeof(Ind.Left))
		{
			Left = Ind.Left;
		}
		if("undefined" != typeof(Ind.Right))
		{
			Right = Ind.Right;
		}
	}

	this.Internal_Update_Ind_Left(Left);
	this.Internal_Update_Ind_FirstLine(FirstLine,Left);
	this.Internal_Update_Ind_Right(Right);
2606
};
2607 2608 2609 2610 2611 2612
asc_docs_api.prototype.Internal_Update_Ind_FirstLine = function(FirstLine,Left){
	if (this.WordControl.m_oHorRuler.m_dIndentLeftFirst != (FirstLine + Left))
    {
        this.WordControl.m_oHorRuler.m_dIndentLeftFirst = (FirstLine + Left);
	    this.WordControl.UpdateHorRuler();
    }
2613
};
2614 2615 2616 2617 2618 2619
asc_docs_api.prototype.Internal_Update_Ind_Left = function(Left){
    if (this.WordControl.m_oHorRuler.m_dIndentLeft != Left)
    {
        this.WordControl.m_oHorRuler.m_dIndentLeft = Left;
        this.WordControl.UpdateHorRuler();
    }
2620
};
2621 2622 2623 2624 2625 2626
asc_docs_api.prototype.Internal_Update_Ind_Right = function(Right){
    if (this.WordControl.m_oHorRuler.m_dIndentRight != Right)
    {
        this.WordControl.m_oHorRuler.m_dIndentRight = Right;
        this.WordControl.UpdateHorRuler();
    }
2627
};
2628 2629 2630 2631


asc_docs_api.prototype.sync_DocSizeCallback = function(width,height){
	this.asc_fireCallback("asc_onDocSize",width,height);
2632
};
2633 2634
asc_docs_api.prototype.sync_PageOrientCallback = function(isPortrait){
	this.asc_fireCallback("asc_onPageOrient",isPortrait);
2635
};
2636
asc_docs_api.prototype.sync_HeadersAndFootersPropCallback = function(hafProp){
2637
    this.SelectedObjectsStack[this.SelectedObjectsStack.length] = new asc_CSelectedObject( c_oAscTypeSelectElement.Header, new CHeaderProp( hafProp ) );
2638
};
2639 2640 2641 2642 2643

/*----------------------------------------------------------------*/
/*functions for working with table*/
asc_docs_api.prototype.put_Table = function(col,row)
{
2644
    this.WordControl.m_oLogicDocument.Add_FlowTable(col,row);
2645
};
2646 2647
asc_docs_api.prototype.addRowAbove = function(count)
{
2648 2649 2650
    var doc = this.WordControl.m_oLogicDocument;
    if(doc.Document_Is_SelectionLocked(changestype_Drawing_Props) === false)
    {
2651
        this.WordControl.m_oLogicDocument.Create_NewHistoryPoint(AscDFH.historydescription_Presentation_AddRowAbove);
2652 2653
        this.WordControl.m_oLogicDocument.Table_AddRow(true);
    }
2654
};
2655 2656
asc_docs_api.prototype.addRowBelow = function(count)
{
2657 2658 2659
    var doc = this.WordControl.m_oLogicDocument;
    if(doc.Document_Is_SelectionLocked(changestype_Drawing_Props) === false)
    {
2660
        this.WordControl.m_oLogicDocument.Create_NewHistoryPoint(AscDFH.historydescription_Presentation_AddRowBelow);
2661 2662
        this.WordControl.m_oLogicDocument.Table_AddRow(false);
    }
2663
};
2664 2665
asc_docs_api.prototype.addColumnLeft = function(count)
{
2666 2667 2668
    var doc = this.WordControl.m_oLogicDocument;
    if(doc.Document_Is_SelectionLocked(changestype_Drawing_Props) === false)
    {
2669
        this.WordControl.m_oLogicDocument.Create_NewHistoryPoint(AscDFH.historydescription_Presentation_AddColLeft);
2670 2671
        this.WordControl.m_oLogicDocument.Table_AddCol(true);
    }
2672
};
2673 2674
asc_docs_api.prototype.addColumnRight = function(count)
{
2675 2676 2677
    var doc = this.WordControl.m_oLogicDocument;
    if(doc.Document_Is_SelectionLocked(changestype_Drawing_Props) === false)
    {
2678
        this.WordControl.m_oLogicDocument.Create_NewHistoryPoint(AscDFH.historydescription_Presentation_AddColRight);
2679 2680
        this.WordControl.m_oLogicDocument.Table_AddCol(false);
    }
2681
};
2682 2683
asc_docs_api.prototype.remRow = function()
{
2684 2685 2686
    var doc = this.WordControl.m_oLogicDocument;
    if(doc.Document_Is_SelectionLocked(changestype_Drawing_Props) === false)
    {
2687
        this.WordControl.m_oLogicDocument.Create_NewHistoryPoint(AscDFH.historydescription_Presentation_RemoveRow);
2688 2689
        this.WordControl.m_oLogicDocument.Table_RemoveRow();
    }
2690
};
2691 2692
asc_docs_api.prototype.remColumn = function()
{
2693 2694 2695
    var doc = this.WordControl.m_oLogicDocument;
    if(doc.Document_Is_SelectionLocked(changestype_Drawing_Props) === false)
    {
2696
        this.WordControl.m_oLogicDocument.Create_NewHistoryPoint(AscDFH.historydescription_Presentation_RemoveCol);
2697 2698
        this.WordControl.m_oLogicDocument.Table_RemoveCol();
    }
2699
};
2700 2701
asc_docs_api.prototype.remTable = function()
{
2702 2703 2704
    var doc = this.WordControl.m_oLogicDocument;
    if(doc.Document_Is_SelectionLocked(changestype_Drawing_Props) === false)
    {
2705
        this.WordControl.m_oLogicDocument.Create_NewHistoryPoint(AscDFH.historydescription_Presentation_RemoveTable);
2706 2707
        this.WordControl.m_oLogicDocument.Table_RemoveTable();
    }
2708
};
2709 2710 2711
asc_docs_api.prototype.selectRow = function()
{
    this.WordControl.m_oLogicDocument.Table_Select( c_oAscTableSelectionType.Row );
2712
};
2713 2714 2715
asc_docs_api.prototype.selectColumn = function()
{
    this.WordControl.m_oLogicDocument.Table_Select( c_oAscTableSelectionType.Column );
2716
};
2717 2718 2719
asc_docs_api.prototype.selectCell = function()
{
    this.WordControl.m_oLogicDocument.Table_Select( c_oAscTableSelectionType.Cell );
2720
};
2721 2722 2723
asc_docs_api.prototype.selectTable = function()
{
    this.WordControl.m_oLogicDocument.Table_Select( c_oAscTableSelectionType.Table );
2724
};
2725 2726
asc_docs_api.prototype.setColumnWidth = function(width){

2727
};
2728 2729
asc_docs_api.prototype.setRowHeight = function(height){

2730
};
2731 2732
asc_docs_api.prototype.set_TblDistanceFromText = function(left,top,right,bottom){
	
2733
};
2734 2735 2736
asc_docs_api.prototype.CheckBeforeMergeCells = function()
{
    return this.WordControl.m_oLogicDocument.Table_CheckMerge();
2737
};
2738 2739 2740
asc_docs_api.prototype.CheckBeforeSplitCells = function()
{
    return this.WordControl.m_oLogicDocument.Table_CheckSplit();
2741
};
2742 2743
asc_docs_api.prototype.MergeCells = function()
{
2744 2745 2746
    var doc = this.WordControl.m_oLogicDocument;
    if(doc.Document_Is_SelectionLocked(changestype_Drawing_Props) === false)
    {
2747
        this.WordControl.m_oLogicDocument.Create_NewHistoryPoint(AscDFH.historydescription_Presentation_MergeCells);
2748 2749
        this.WordControl.m_oLogicDocument.Table_MergeCells();
    }
2750
};
2751 2752
asc_docs_api.prototype.SplitCell = function(Cols, Rows)
{
2753 2754 2755
    var doc = this.WordControl.m_oLogicDocument;
    if(doc.Document_Is_SelectionLocked(changestype_Drawing_Props) === false)
    {
2756
        this.WordControl.m_oLogicDocument.Create_NewHistoryPoint(AscDFH.historydescription_Presentation_SplitCells);
2757 2758
        this.WordControl.m_oLogicDocument.Table_SplitCell(Cols, Rows);
    }
2759
};
2760 2761
asc_docs_api.prototype.widthTable = function(width){

2762
};
2763 2764
asc_docs_api.prototype.put_CellsMargin = function(left,top,right,bottom){
	
2765
};
2766 2767
asc_docs_api.prototype.set_TblWrap = function(type){

2768
};
2769 2770
asc_docs_api.prototype.set_TblIndentLeft = function(spacing){

2771
};
2772 2773
asc_docs_api.prototype.set_Borders = function(typeBorders,size,Color){//если size == 0 то границы нет.

2774
};
2775 2776 2777
asc_docs_api.prototype.set_TableBackground = function(Color)
{

2778
};
2779 2780 2781 2782 2783 2784 2785
asc_docs_api.prototype.set_AlignCell = function(align){// c_oAscAlignType.RIGHT, c_oAscAlignType.LEFT, c_oAscAlignType.CENTER
	switch(align)
	{
		case c_oAscAlignType.LEFT : break;
		case c_oAscAlignType.CENTER : break;
		case c_oAscAlignType.RIGHT : break;
	}
2786
};
2787 2788 2789 2790 2791 2792 2793
asc_docs_api.prototype.set_TblAlign = function(align){// c_oAscAlignType.RIGHT, c_oAscAlignType.LEFT, c_oAscAlignType.CENTER
	switch(align)
	{
		case c_oAscAlignType.LEFT : break;
		case c_oAscAlignType.CENTER : break;
		case c_oAscAlignType.RIGHT : break;
	}
2794
};
2795 2796 2797 2798
asc_docs_api.prototype.set_SpacingBetweenCells = function(isOn,spacing){// c_oAscAlignType.RIGHT, c_oAscAlignType.LEFT, c_oAscAlignType.CENTER
	if(isOn){
	
	}
2799
};
2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962


/*
	{
	    TableWidth   : null - галочка убрана, либо заданное значение в мм
	    TableSpacing : null - галочка убрана, либо заданное значение в мм

	    TableDefaultMargins :  // маргины для всей таблицы(значение по умолчанию)
	    {
	        Left   : 1.9,
	        Right  : 1.9,
	        Top    : 0,
	        Bottom : 0
	    }

	    CellMargins :
        {
            Left   : 1.9, (null - неопределенное значение)
            Right  : 1.9, (null - неопределенное значение)
            Top    : 0,   (null - неопределенное значение)
            Bottom : 0,   (null - неопределенное значение)
            Flag   : 0 - У всех выделенных ячеек значение берется из TableDefaultMargins
                     1 - У выделенных ячеек есть ячейки с дефолтовыми значениями, и есть со своими собственными
                     2 - У всех ячеек свои собственные значения
        }

        TableAlignment : 0, 1, 2 (слева, по центру, справа)
        TableIndent : значение в мм,
        TableWrappingStyle : 0, 1 (inline, flow)
        TablePaddings:
        {
             Left   : 3.2,
             Right  : 3.2,
             Top    : 0,
             Bottom : 0
        }

        TableBorders : // границы таблицы
        {
            Bottom :
            {
                Color : { r : 0, g : 0, b : 0 },
                Value : border_Single,
                Size  : 0.5 * g_dKoef_pt_to_mm
				Space :
            },

            Left :
            {
                Color : { r : 0, g : 0, b : 0 },
                Value : border_Single,
                Size  : 0.5 * g_dKoef_pt_to_mm
				Space :
            },

            Right :
            {
                Color : { r : 0, g : 0, b : 0 },
                Value : border_Single,
                Size  : 0.5 * g_dKoef_pt_to_mm
				Space :
            },

            Top :
            {
                Color : { r : 0, g : 0, b : 0 },
                Value : border_Single,
                Size  : 0.5 * g_dKoef_pt_to_mm
				Space :
            },

            InsideH :
            {
                Color : { r : 0, g : 0, b : 0 },
                Value : border_Single,
                Size  : 0.5 * g_dKoef_pt_to_mm
				Space :
            },

            InsideV :
            {
                Color : { r : 0, g : 0, b : 0 },
                Value : border_Single,
                Size  : 0.5 * g_dKoef_pt_to_mm
				Space :
            }
        }

        CellBorders : // границы выделенных ячеек
        {
			ForSelectedCells : true,
			
            Bottom :
            {
                Color : { r : 0, g : 0, b : 0 },
                Value : border_Single,
                Size  : 0.5 * g_dKoef_pt_to_mm
				Space :
            },

            Left :
            {
                Color : { r : 0, g : 0, b : 0 },
                Value : border_Single,
                Size  : 0.5 * g_dKoef_pt_to_mm
				Space :
            },

            Right :
            {
                Color : { r : 0, g : 0, b : 0 },
                Value : border_Single,
                Size  : 0.5 * g_dKoef_pt_to_mm
				Space :
            },

            Top :
            {
                Color : { r : 0, g : 0, b : 0 },
                Value : border_Single,
                Size  : 0.5 * g_dKoef_pt_to_mm
				Space :
            },

            InsideH : // данного элемента может не быть, если у выделенных ячеек
                      // нет горизонтальных внутренних границ
            {
                Color : { r : 0, g : 0, b : 0 },
                 Value : border_Single,
                Size  : 0.5 * g_dKoef_pt_to_mm
				Space :
            },

            InsideV : // данного элемента может не быть, если у выделенных ячеек
                      // нет вертикальных внутренних границ
            {
                Color : { r : 0, g : 0, b : 0 },
                Value : border_Single,
                Size  : 0.5 * g_dKoef_pt_to_mm
				Space :
            }
        }

        TableBackground :
        {
            Value : тип заливки(прозрачная или нет),
            Color : { r : 0, g : 0, b : 0 }
        }
        CellsBackground : null если заливка не определена для выделенных ячеек
        {
            Value : тип заливки(прозрачная или нет),
            Color : { r : 0, g : 0, b : 0 }
        }
        
		Position:
		{
			X:0,
			Y:0
		}
	}
*/
asc_docs_api.prototype.tblApply = function(obj)
{
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
2963 2964 2965
    var doc = this.WordControl.m_oLogicDocument;
    if(doc.Document_Is_SelectionLocked(changestype_Drawing_Props) === false)
    {
2966
        this.WordControl.m_oLogicDocument.Create_NewHistoryPoint(AscDFH.historydescription_Presentation_TblApply);
2967 2968 2969 2970
        if(obj.CellBorders)
        {
            if(obj.CellBorders.Left && obj.CellBorders.Left.Color)
            {
2971
                obj.CellBorders.Left.Unifill = AscFormat.CreateUnifillFromAscColor(obj.CellBorders.Left.Color);
2972 2973 2974
            }
            if(obj.CellBorders.Top && obj.CellBorders.Top.Color)
            {
2975
                obj.CellBorders.Top.Unifill = AscFormat.CreateUnifillFromAscColor(obj.CellBorders.Top.Color);
2976 2977 2978
            }
            if(obj.CellBorders.Right && obj.CellBorders.Right.Color)
            {
2979
                obj.CellBorders.Right.Unifill = AscFormat.CreateUnifillFromAscColor(obj.CellBorders.Right.Color);
2980 2981 2982
            }
            if(obj.CellBorders.Bottom && obj.CellBorders.Bottom.Color)
            {
2983
                obj.CellBorders.Bottom.Unifill = AscFormat.CreateUnifillFromAscColor(obj.CellBorders.Bottom.Color);
2984 2985 2986
            }
            if(obj.CellBorders.InsideH && obj.CellBorders.InsideH.Color)
            {
2987
                obj.CellBorders.InsideH.Unifill = AscFormat.CreateUnifillFromAscColor(obj.CellBorders.InsideH.Color);
2988 2989 2990
            }
            if(obj.CellBorders.InsideV && obj.CellBorders.InsideV.Color)
            {
2991
                obj.CellBorders.InsideV.Unifill = AscFormat.CreateUnifillFromAscColor(obj.CellBorders.InsideV.Color);
2992 2993 2994 2995
            }
        }
        if(obj.CellsBackground && obj.CellsBackground.Color)
        {
2996
            obj.CellsBackground.Unifill = AscFormat.CreateUnifillFromAscColor(obj.CellsBackground.Color);
2997
        }
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
2998 2999
        this.WordControl.m_oLogicDocument.Set_TableProps(obj);
    }
3000
};
3001 3002 3003
/*callbacks*/
asc_docs_api.prototype.sync_AddTableCallback = function(){
	this.asc_fireCallback("asc_onAddTable");
3004
};
3005 3006
asc_docs_api.prototype.sync_AlignCellCallback = function(align){
	this.asc_fireCallback("asc_onAlignCell",align);
3007
};
3008
asc_docs_api.prototype.sync_TblPropCallback = function(tblProp){
3009
    this.SelectedObjectsStack[this.SelectedObjectsStack.length] = new asc_CSelectedObject( c_oAscTypeSelectElement.Table, new Asc.CTableProp( tblProp ));
3010
};
3011 3012
asc_docs_api.prototype.sync_TblWrapStyleChangedCallback = function(style){
	this.asc_fireCallback("asc_onTblWrapStyleChanged",style);
3013
};
3014 3015
asc_docs_api.prototype.sync_TblAlignChangedCallback = function(style){
	this.asc_fireCallback("asc_onTblAlignChanged",style);
3016
};
3017 3018 3019 3020 3021 3022

/*----------------------------------------------------------------*/
/*functions for working with images*/
asc_docs_api.prototype.ChangeImageFromFile = function()
{
    this.isImageChangeUrl = true;
3023
    this.asc_addImage();
3024
};
3025 3026 3027
asc_docs_api.prototype.ChangeShapeImageFromFile = function()
{
    this.isShapeImageChangeUrl = true;
3028
    this.asc_addImage();
3029
};
3030 3031 3032
asc_docs_api.prototype.ChangeSlideImageFromFile = function()
{
    this.isSlideImageChangeUrl = true;
3033
    this.asc_addImage();
3034
};
3035 3036 3037
asc_docs_api.prototype.ChangeArtImageFromFile = function()
{
    this.isTextArtChangeUrl = true;
3038
    this.asc_addImage();
3039
};
3040 3041

asc_docs_api.prototype.AddImage = function(){
3042
  this.asc_addImage();
3043
};
3044 3045 3046 3047 3048 3049 3050 3051
asc_docs_api.prototype.StartAddShape = function(prst, is_apply)
{
    this.WordControl.m_oLogicDocument.StartAddShape(prst, is_apply);

    if (is_apply)
    {
        this.WordControl.m_oDrawingDocument.LockCursorType("crosshair");
    }
3052
};
3053

3054 3055 3056 3057 3058
asc_docs_api.prototype.AddTextArt = function(nStyle)
{
    if(editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Drawing_Props) === false) {
        this.WordControl.m_oLogicDocument.Add_TextArt(nStyle);
    }
3059
};
3060

3061 3062 3063 3064

asc_docs_api.prototype.canGroup = function()
{
    return this.WordControl.m_oLogicDocument.canGroup();
3065
};
3066 3067 3068 3069

asc_docs_api.prototype.canUnGroup = function()
{
    return this.WordControl.m_oLogicDocument.canUnGroup();
3070
};
3071

3072 3073 3074 3075
asc_docs_api.prototype._addImageUrl = function(url) {
  // ToDo пока временная функция для стыковки.
  this.AddImageUrl(url);
};
3076
asc_docs_api.prototype.AddImageUrl = function(url){
3077
	if(g_oDocumentUrls.getLocal(url))
3078 3079 3080 3081 3082
	{
		this.AddImageUrlAction(url);
	}
	else
	{
3083
		var rData = {
Alexander.Trofimov's avatar
Alexander.Trofimov committed
3084
			"id":this.documentId,
3085
			"userid": this.documentUserId,
3086
			"vkey": this.documentVKey,
3087
			"c":"imgurl",
3088
			"saveindex": g_oDocumentUrls.getMaxIndex(),
3089 3090
			"data": url};
			
3091
		var t = this;
3092
		this.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage);
3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111
		this.fCurCallback = function(input) {
			if(null != input && "imgurl" == input["type"]){
				if("ok" ==input["status"]) {
					var data = input["data"];
					var urls = {};
					var firstUrl;
					for(var i = 0; i < data.length; ++i){
						var elem = data[i];
						if(elem.url){
							if(!firstUrl){
								firstUrl = elem.url;
							}
							urls[elem.path] = elem.url;
						}
					}
					g_oDocumentUrls.addUrls(urls);
					if(firstUrl) {
						t.AddImageUrlAction(firstUrl);
					} else {
3112
						t.asc_fireCallback("asc_onError",c_oAscError.ID.Unknown,c_oAscError.Level.NoCritical);
3113 3114
					}
				} else {
3115
					t.asc_fireCallback("asc_onError", mapAscServerErrorToAscError(parseInt(input["data"])), c_oAscError.Level.NoCritical);
3116 3117
				}
			} else {
3118
				t.asc_fireCallback("asc_onError",c_oAscError.ID.Unknown,c_oAscError.Level.NoCritical);
3119 3120 3121
			}
			t.sync_EndAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage);
		};
3122
		sendCommand(this, null, rData );
3123 3124
	}
};
3125 3126 3127

asc_docs_api.prototype.AddImageUrlActionCallback = function(_image)
{
3128 3129
    var _w = AscCommon.Page_Width - (AscCommon.X_Left_Margin + AscCommon.X_Right_Margin);
    var _h = AscCommon.Page_Height - (AscCommon.Y_Top_Margin + AscCommon.Y_Bottom_Margin);
3130 3131
    if (_image.Image != null)
    {
3132 3133
        var __w = Math.max((_image.Image.width * AscCommon.g_dKoef_pix_to_mm) >> 0, 1);
        var __h = Math.max((_image.Image.height * AscCommon.g_dKoef_pix_to_mm) >> 0, 1);
3134 3135 3136 3137 3138 3139 3140
        _w = Math.max(5, Math.min(_w, __w));
        _h = Math.max(5, Math.min((_w * __h / __w) >> 0));
    }

    var src = _image.src;
    if (this.isShapeImageChangeUrl)
    {
3141
        var AscShapeProp = new Asc.asc_CShapeProperty();
3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160
        AscShapeProp.fill = new asc_CShapeFill();
        AscShapeProp.fill.type = c_oAscFill.FILL_TYPE_BLIP;
        AscShapeProp.fill.fill = new asc_CFillBlip();
        AscShapeProp.fill.fill.asc_putUrl(src);
        this.ShapeApply(AscShapeProp);
        this.isShapeImageChangeUrl = false;
    }
    else if (this.isSlideImageChangeUrl)
    {
        var AscSlideProp = new CAscSlideProps();
        AscSlideProp.Background = new asc_CShapeFill();
        AscSlideProp.Background.type = c_oAscFill.FILL_TYPE_BLIP;
        AscSlideProp.Background.fill = new asc_CFillBlip();
        AscSlideProp.Background.fill.asc_putUrl(src);
        this.SetSlideProps(AscSlideProp);
        this.isSlideImageChangeUrl = false;
    }
    else if (this.isImageChangeUrl)
    {
3161
        var AscImageProp = new Asc.asc_CImgProperty();
3162 3163 3164 3165 3166 3167
        AscImageProp.ImageUrl = src;
        this.ImgApply(AscImageProp);
        this.isImageChangeUrl = false;
    }
    else if (this.isTextArtChangeUrl)
    {
3168
        var AscShapeProp = new Asc.asc_CShapeProperty();
3169 3170 3171 3172
        var oFill = new asc_CShapeFill();
        oFill.type = c_oAscFill.FILL_TYPE_BLIP;
        oFill.fill = new asc_CFillBlip();
        oFill.fill.asc_putUrl(src);
3173
        AscShapeProp.textArtProperties = new Asc.asc_TextArtProperties();
3174 3175 3176 3177 3178 3179
        AscShapeProp.textArtProperties.asc_putFill(oFill);
        this.ShapeApply(AscShapeProp);
        this.isTextArtChangeUrl = false;
    }
    else
    {
3180 3181 3182 3183
        var srcLocal = g_oDocumentUrls.getImageLocal(src);
        if (srcLocal) {
            src = srcLocal;
        }
3184 3185 3186

        this.WordControl.m_oLogicDocument.Add_FlowImage(_w, _h, src);
    }
Alexander.Trofimov's avatar
Alexander.Trofimov committed
3187
};
3188

3189
asc_docs_api.prototype.AddImageUrlAction = function(url){
3190 3191 3192
    var _image = this.ImageLoader.LoadImage(url, 1);
    if (null != _image)
    {
3193
        this.AddImageUrlActionCallback(_image);
3194 3195 3196 3197 3198 3199
    }
	else
    {
        this.sync_StartAction(c_oAscAsyncActionType.Information, c_oAscAsyncAction.LoadImage);
		this.asyncImageEndLoaded2 = function(_image)
        {
3200
            this.AddImageUrlActionCallback(_image);
3201 3202 3203 3204 3205
            this.sync_EndAction(c_oAscAsyncActionType.Information, c_oAscAsyncAction.LoadImage);

            this.asyncImageEndLoaded2 = null;
		}
	}
3206
};
3207 3208
/* В качестве параметра  передается объект класса Asc.asc_CImgProperty, он же приходит на OnImgProp
 Asc.asc_CImgProperty заменяет пережнюю структуру:
3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219
если параметр не имеет значения то передвать следует null, напримере inline-картинок: в качестве left,top,bottom,right,X,Y,ImageUrl необходимо передавать null.
	{
		Width: 0,
		Height: 0,
		WrappingStyle: 0,
		Paddings: { Left : 0, Top : 0, Bottom: 0, Right: 0 },
		Position : {X : 0, Y : 0},
		ImageUrl : ""
	}
*/
asc_docs_api.prototype.ImgApply = function(obj){
3220
    var ImagePr = {};
3221 3222 3223 3224
	
    ImagePr.Width  = null === obj.Width ? null : parseFloat(obj.Width);
    ImagePr.Height = null === obj.Height ? null : parseFloat(obj.Height);

Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
3225
	if( undefined != obj.Position )
3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240
	{
		ImagePr.Position =
		{
			X : null === obj.Position.X ? null : parseFloat(obj.Position.X),
			Y : null === obj.Position.Y ? null : parseFloat(obj.Position.Y)
		};
	}
	else
	{
		ImagePr.Position = {X : null, Y : null};	
	}
	
	ImagePr.ImageUrl = obj.ImageUrl;


3241
	if(!AscCommon.isNullOrEmptyString(ImagePr.ImageUrl)){
3242 3243 3244 3245
      var sImageUrl = null;
      if(!g_oDocumentUrls.getImageLocal(ImagePr.ImageUrl)){
        sImageUrl = ImagePr.ImageUrl;
      }
3246

3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288
      var oApi = this;
      var fApplyCallback = function(){
        var _img = oApi.ImageLoader.LoadImage(ImagePr.ImageUrl, 1);
        var srcLocal = g_oDocumentUrls.getImageLocal(ImagePr.ImageUrl);
        if (srcLocal){
          ImagePr.ImageUrl = srcLocal;
        }
        if (null != _img){
          oApi.WordControl.m_oLogicDocument.Set_ImageProps( ImagePr );
        }
        else{
            oApi.asyncImageEndLoaded2 = function(_image){
              oApi.WordControl.m_oLogicDocument.Set_ImageProps( ImagePr );
              oApi.asyncImageEndLoaded2 = null;
          }
        }
      };
      if(!sImageUrl){
        fApplyCallback();
      }
      else{
        this.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage);
        this.fCurCallback = function(input) {
          if(null != input && "imgurl" == input["type"]){
            if("ok" ==input["status"]) {
              var data = input["data"];
              var urls = {};
              var firstUrl;
              for(var i = 0; i < data.length; ++i){
                var elem = data[i];
                if(elem.url){
                  if(!firstUrl){
                    firstUrl = elem.url;
                  }
                  urls[elem.path] = elem.url;
                }
              }
              g_oDocumentUrls.addUrls(urls);
              if(firstUrl) {
                ImagePr.ImageUrl = firstUrl;
                fApplyCallback();
              } else {
3289
                oApi.asc_fireCallback("asc_onError",c_oAscError.ID.Unknown,c_oAscError.Level.NoCritical);
3290 3291
              }
            } else {
3292
              oApi.asc_fireCallback("asc_onError", mapAscServerErrorToAscError(parseInt(input["data"])), c_oAscError.Level.NoCritical);
3293 3294
            }
          } else {
3295
            oApi.asc_fireCallback("asc_onError",c_oAscError.ID.Unknown,c_oAscError.Level.NoCritical);
3296 3297 3298 3299 3300
          }
          oApi.sync_EndAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.UploadImage);
        };

        var rData = {
Alexander.Trofimov's avatar
Alexander.Trofimov committed
3301
          "id":this.documentId,
3302
          "userid": this.documentUserId,
3303
          "vkey": this.documentVKey,
3304 3305 3306
          "c":"imgurl",
          "saveindex": g_oDocumentUrls.getMaxIndex(),
          "data": sImageUrl};
3307
        sendCommand(this, null, rData );
3308
      }
3309 3310 3311 3312 3313 3314
	}
	else
    {
		ImagePr.ImageUrl = null;
		this.WordControl.m_oLogicDocument.Set_ImageProps( ImagePr );
	}
3315
};
3316

Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
3317 3318
asc_docs_api.prototype.ChartApply = function(obj)
{
3319
    if(obj.ChartProperties && obj.ChartProperties.type === Asc.c_oAscChartTypeSettings.stock && this.WordControl.m_oLogicDocument.Slides[this.WordControl.m_oLogicDocument.CurPage])
3320
    {
3321
        if(!AscFormat.CheckStockChart(this.WordControl.m_oLogicDocument.Slides[this.WordControl.m_oLogicDocument.CurPage].graphicObjects, this))
3322 3323 3324 3325
        {
            return;
        }
    }
3326
    this.WordControl.m_oLogicDocument.ChartApply(obj);
Alexander.Trofimov's avatar
Alexander.Trofimov committed
3327
};
3328 3329
asc_docs_api.prototype.set_Size = function(width, height){

3330
};
3331 3332 3333 3334 3335 3336 3337
asc_docs_api.prototype.set_ConstProportions = function(isOn){
	if (isOn){
	
	}
	else{
	
	}
3338
};
3339 3340
asc_docs_api.prototype.set_WrapStyle = function(type){

3341
};
3342 3343
asc_docs_api.prototype.deleteImage = function(){

3344
};
3345 3346
asc_docs_api.prototype.set_ImgDistanceFromText = function(left,top,right,bottom){
	
3347
};
3348 3349
asc_docs_api.prototype.set_PositionOnPage = function(X,Y){//расположение от начала страницы
	
3350
};
3351 3352 3353 3354 3355 3356 3357
asc_docs_api.prototype.get_OriginalSizeImage = function(){
	if (0 == this.SelectedObjectsStack.length)
        return null;
    var obj = this.SelectedObjectsStack[this.SelectedObjectsStack.length - 1];
    if (obj == null)
        return null;
    if (obj.Type == c_oAscTypeSelectElement.Image)
3358
        return obj.Value.asc_getOriginSize(this);
3359
};
3360 3361 3362
/*callbacks*/
asc_docs_api.prototype.sync_AddImageCallback = function(){
	this.asc_fireCallback("asc_onAddImage");
3363
};
3364
asc_docs_api.prototype.sync_ImgPropCallback = function(imgProp){
3365 3366 3367 3368 3369 3370 3371 3372
    var type = imgProp.chartProps ? c_oAscTypeSelectElement.Chart : c_oAscTypeSelectElement.Image;
    var objects;
    if(type === c_oAscTypeSelectElement.Chart)
    {
        objects = new CAscChartProp(imgProp);
    }
    else
    {
3373
        objects = new Asc.asc_CImgProperty(imgProp);
3374
    }
3375
    this.SelectedObjectsStack[this.SelectedObjectsStack.length] = new asc_CSelectedObject( type,  objects);
3376
};
3377

Oleg.Korshul's avatar
Oleg.Korshul committed
3378 3379
asc_docs_api.prototype.SetDrawingFreeze = function(bIsFreeze)
{
3380 3381 3382 3383 3384
  if (!this.isLoadFullApi) {
    this.tmpIsFreeze = bIsFreeze;
    return;
  }

Oleg.Korshul's avatar
Oleg.Korshul committed
3385 3386 3387 3388 3389
    this.WordControl.DrawingFreeze = bIsFreeze;

    var _elem1 = document.getElementById("id_main");
    if (_elem1)
    {
Oleg.Korshul's avatar
Oleg.Korshul committed
3390 3391
        var _elem2 = document.getElementById("id_panel_thumbnails");
        var _elem3 = document.getElementById("id_panel_notes");
Oleg.Korshul's avatar
Oleg.Korshul committed
3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404
        if (bIsFreeze)
        {
            _elem1.style.display = "none";
            _elem2.style.display = "none";
            _elem3.style.display = "none";
        }
        else
        {
            _elem1.style.display = "block";
            _elem2.style.display = "block";
            _elem3.style.display = "block";
        }
    }
Oleg.Korshul's avatar
Oleg.Korshul committed
3405 3406 3407

    if (!bIsFreeze)
        this.WordControl.OnScroll();
3408
};
Oleg.Korshul's avatar
Oleg.Korshul committed
3409

3410 3411 3412 3413
/*----------------------------------------------------------------*/
/*functions for working with zoom & navigation*/
asc_docs_api.prototype.zoomIn = function(){
    this.WordControl.zoom_In();
3414
};
3415 3416
asc_docs_api.prototype.zoomOut = function(){
    this.WordControl.zoom_Out();
3417
};
3418
asc_docs_api.prototype.zoomFitToPage = function(){
Alexander.Trofimov's avatar
Alexander.Trofimov committed
3419 3420 3421 3422
  if (!this.isLoadFullApi) {
    this.tmpZoomType = AscCommon.c_oZoomType.FitToPage;
    return;
  }
3423
    this.WordControl.zoom_FitToPage();
3424
};
3425
asc_docs_api.prototype.zoomFitToWidth = function(){
Alexander.Trofimov's avatar
Alexander.Trofimov committed
3426 3427 3428 3429
  if (!this.isLoadFullApi) {
    this.tmpZoomType = AscCommon.c_oZoomType.FitToWidth;
    return;
  }
3430
    this.WordControl.zoom_FitToWidth();
3431
};
3432
asc_docs_api.prototype.zoomCustomMode = function(){
Alexander.Trofimov's avatar
Alexander.Trofimov committed
3433 3434 3435 3436
  if (!this.isLoadFullApi) {
    this.tmpZoomType = AscCommon.c_oZoomType.CustomMode;
    return;
  }
3437 3438
    this.WordControl.m_nZoomType = 0;
    this.WordControl.zoom_Fire();
3439
};
3440 3441 3442
asc_docs_api.prototype.zoom100 = function(){
    this.WordControl.m_nZoomValue = 100;
    this.WordControl.zoom_Fire();
3443
};
3444 3445 3446
asc_docs_api.prototype.zoom = function(percent){
    this.WordControl.m_nZoomValue = percent;
    this.WordControl.zoom_Fire(0);
3447
};
3448 3449
asc_docs_api.prototype.goToPage = function(number){
	this.WordControl.GoToPage(number);
3450
};
3451 3452
asc_docs_api.prototype.getCountPages = function(){
	return this.WordControl.m_oDrawingDocument.SlidesCount;
3453
};
3454 3455
asc_docs_api.prototype.getCurrentPage = function(){
	return this.WordControl.m_oDrawingDocument.SlideCurrent;
3456
};
3457 3458 3459
/*callbacks*/
asc_docs_api.prototype.sync_zoomChangeCallback = function(percent,type){	//c_oAscZoomType.Current, c_oAscZoomType.FitWidth, c_oAscZoomType.FitPage
	this.asc_fireCallback("asc_onZoomChange",percent,type);
3460
};
3461 3462
asc_docs_api.prototype.sync_countPagesCallback = function(count){
	this.asc_fireCallback("asc_onCountPages",count);
3463
};
3464 3465
asc_docs_api.prototype.sync_currentPageCallback = function(number){
	this.asc_fireCallback("asc_onCurrentPage",number);
3466
};
3467 3468 3469 3470

asc_docs_api.prototype.sync_SendThemeColors = function(colors,standart_colors)
{
    this.asc_fireCallback("asc_onSendThemeColors",colors,standart_colors);
3471
};
3472 3473 3474 3475

asc_docs_api.prototype.sync_SendThemeColorSchemes = function(param)
{
    this.asc_fireCallback("asc_onSendThemeColorSchemes",param);
3476
};
3477 3478 3479

asc_docs_api.prototype.ChangeColorScheme = function(index_scheme)
{
3480 3481
  var oColorScheme = AscCommon.g_oUserColorScheme;
    var _count_defaults = oColorScheme.length;
3482 3483
    if (index_scheme < _count_defaults)
    {
3484
        var _obj = oColorScheme[index_scheme];
3485
        var scheme = new AscFormat.ClrScheme();
3486
		scheme.name = _obj.name;
3487 3488
        var _c = null;

3489 3490
        _c = _obj.dk1;
        scheme.colors[8] = AscFormat.CreateUniColorRGB(_c.R, _c.G, _c.B);
3491

3492 3493
        _c = _obj.lt1;
        scheme.colors[12] = AscFormat.CreateUniColorRGB(_c.R, _c.G, _c.B);
3494

3495 3496
        _c = _obj.dk2;
        scheme.colors[9] = AscFormat.CreateUniColorRGB(_c.R, _c.G, _c.B);
3497

3498 3499
        _c = _obj.lt2;
        scheme.colors[13] = AscFormat.CreateUniColorRGB(_c.R, _c.G, _c.B);
3500

3501 3502
        _c = _obj.accent1;
        scheme.colors[0] = AscFormat.CreateUniColorRGB(_c.R, _c.G, _c.B);
3503

3504 3505
        _c = _obj.accent2;
        scheme.colors[1] = AscFormat.CreateUniColorRGB(_c.R, _c.G, _c.B);
3506

3507 3508
        _c = _obj.accent3;
        scheme.colors[2] = AscFormat.CreateUniColorRGB(_c.R, _c.G, _c.B);
3509

3510 3511
        _c = _obj.accent4;
        scheme.colors[3] = AscFormat.CreateUniColorRGB(_c.R, _c.G, _c.B);
3512

3513 3514
        _c = _obj.accent5;
        scheme.colors[4] = AscFormat.CreateUniColorRGB(_c.R, _c.G, _c.B);
3515

3516 3517
        _c = _obj.accent6;
        scheme.colors[5] = AscFormat.CreateUniColorRGB(_c.R, _c.G, _c.B);
3518

3519 3520
        _c = _obj.hlink;
        scheme.colors[11] = AscFormat.CreateUniColorRGB(_c.R, _c.G, _c.B);
3521

3522 3523
        _c = _obj.folHlink;
        scheme.colors[10] = AscFormat.CreateUniColorRGB(_c.R, _c.G, _c.B);
3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543

        this.WordControl.m_oLogicDocument.changeColorScheme(scheme);
    }
    else
    {
        index_scheme -= _count_defaults;
        if (null == this.WordControl.MasterLayouts)
            return;

        var theme = this.WordControl.MasterLayouts.Theme;
        if (null == theme)
            return;

        if (index_scheme < 0 || index_scheme >= theme.extraClrSchemeLst.length)
            return;

        this.WordControl.m_oLogicDocument.changeColorScheme(theme.extraClrSchemeLst[index_scheme].clrScheme);
    }

    this.WordControl.m_oDrawingDocument.CheckGuiControlColors();
3544
};
3545 3546 3547

/*----------------------------------------------------------------*/
asc_docs_api.prototype.asc_enableKeyEvents = function(value){
Alexander.Trofimov's avatar
Alexander.Trofimov committed
3548 3549 3550 3551 3552
  if (!this.isLoadFullApi) {
    this.tmpFocus = value;
    return;
  }

3553 3554 3555 3556
	if (this.WordControl.IsFocus != value) {
		this.WordControl.IsFocus = value;
		this.asc_fireCallback("asc_onEnableKeyEventsChanged", value);
	}
Alexander.Trofimov's avatar
Alexander.Trofimov committed
3557
};
3558

Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572

//-----------------------------------------------------------------
// Функции для работы с комментариями
//-----------------------------------------------------------------
function asc_CCommentData( obj )
{
    if( obj )
    {
        this.m_sText      = (undefined != obj.m_sText     ) ? obj.m_sText      : "";
        this.m_sTime      = (undefined != obj.m_sTime     ) ? obj.m_sTime      : "";
        this.m_sUserId    = (undefined != obj.m_sUserId   ) ? obj.m_sUserId    : "";
        this.m_sQuoteText = (undefined != obj.m_sQuoteText) ? obj.m_sQuoteText : null;
        this.m_bSolved    = (undefined != obj.m_bSolved   ) ? obj.m_bSolved    : false;
        this.m_sUserName  = (undefined != obj.m_sUserName ) ? obj.m_sUserName  : "";
3573
        this.m_aReplies   = [];
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591
        if ( undefined != obj.m_aReplies )
        {
            var Count = obj.m_aReplies.length;
            for ( var Index = 0; Index < Count; Index++ )
            {
                var Reply = new asc_CCommentData( obj.m_aReplies[Index] );
                this.m_aReplies.push( Reply );
            }
        }
    }
    else
    {
        this.m_sText      = "";
        this.m_sTime      = "";
        this.m_sUserId    = "";
        this.m_sQuoteText = null;
        this.m_bSolved    = false;
        this.m_sUserName  = "";
3592
        this.m_aReplies   = [];
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
3593 3594 3595
    }
}

3596
asc_CCommentData.prototype.asc_getText         = function()  { return this.m_sText; };
3597
asc_CCommentData.prototype.asc_putText         = function(v) { this.m_sText = v ? v.slice(0, Asc.c_oAscMaxCellOrCommentLength) : v; };
3598 3599 3600 3601 3602 3603
asc_CCommentData.prototype.asc_getTime         = function()  { return this.m_sTime; };
asc_CCommentData.prototype.asc_putTime         = function(v) { this.m_sTime = v; };
asc_CCommentData.prototype.asc_getUserId       = function()  { return this.m_sUserId; };
asc_CCommentData.prototype.asc_putUserId       = function(v) { this.m_sUserId = v; };
asc_CCommentData.prototype.asc_getUserName     = function()  { return this.m_sUserName; };
asc_CCommentData.prototype.asc_putUserName     = function(v) { this.m_sUserName = v; };
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
3604 3605 3606 3607
asc_CCommentData.prototype.asc_getQuoteText    = function()  { return this.m_sQuoteText; };
asc_CCommentData.prototype.asc_putQuoteText    = function(v) { this.m_sQuoteText = v; };
asc_CCommentData.prototype.asc_getSolved       = function()  { return this.m_bSolved; };
asc_CCommentData.prototype.asc_putSolved       = function(v) { this.m_bSolved = v; };
3608 3609 3610
asc_CCommentData.prototype.asc_getReply        = function(i) { return this.m_aReplies[i]; };
asc_CCommentData.prototype.asc_addReply        = function(v) { this.m_aReplies.push( v ); };
asc_CCommentData.prototype.asc_getRepliesCount = function(v) { return this.m_aReplies.length; };
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
3611 3612 3613 3614 3615 3616 3617 3618


asc_docs_api.prototype.asc_showComments = function()
{
    if (null == this.WordControl.m_oLogicDocument)
        return;

    this.WordControl.m_oLogicDocument.Show_Comments();
3619
};
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
3620 3621 3622 3623 3624 3625 3626 3627

asc_docs_api.prototype.asc_hideComments = function()
{
    if (null == this.WordControl.m_oLogicDocument)
        return;

    this.WordControl.m_oLogicDocument.Hide_Comments();
    editor.sync_HideComment();
3628
};
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
3629 3630 3631

asc_docs_api.prototype.asc_addComment = function(AscCommentData)
{
3632
};
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
3633 3634 3635 3636

asc_docs_api.prototype.asc_getMasterCommentId = function()
{
    return -1;
3637
};
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
3638 3639 3640 3641

asc_docs_api.prototype.asc_getAnchorPosition = function()
{
    var AnchorPos = this.WordControl.m_oLogicDocument.Get_SelectionAnchorPos();
3642
    return new AscCommon.asc_CRect(AnchorPos.X0, AnchorPos.Y, AnchorPos.X1 - AnchorPos.X0, 0);
3643
};
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
3644 3645 3646 3647 3648 3649

asc_docs_api.prototype.asc_removeComment = function(Id)
{
    if (null == this.WordControl.m_oLogicDocument)
        return;

3650
    if ( false === this.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(AscCommon.changestype_MoveComment, Id ) )
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
3651
    {
3652
        this.WordControl.m_oLogicDocument.Create_NewHistoryPoint(AscDFH.historydescription_Presentation_RemoveComment);
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
3653 3654
        this.WordControl.m_oLogicDocument.Remove_Comment( Id, true );
    }
3655
};
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
3656 3657 3658 3659 3660 3661

asc_docs_api.prototype.asc_changeComment = function(Id, AscCommentData)
{
    if (null == this.WordControl.m_oLogicDocument)
        return;

3662
    //if ( false === this.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_MoveComment, Id ) )
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
3663
    {
Alexander.Trofimov's avatar
Alexander.Trofimov committed
3664
        var CommentData = new AscCommon.CCommentData();
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
3665 3666 3667 3668 3669
        CommentData.Read_FromAscCommentData(AscCommentData);

        this.WordControl.m_oLogicDocument.Change_Comment( Id, CommentData );

    }
3670
};
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
3671 3672 3673 3674 3675 3676 3677

asc_docs_api.prototype.asc_selectComment = function(Id)
{
    if (null == this.WordControl.m_oLogicDocument)
        return;

    this.WordControl.m_oLogicDocument.Select_Comment(Id);
3678
};
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
3679 3680 3681 3682

asc_docs_api.prototype.asc_showComment = function(Id)
{
    this.WordControl.m_oLogicDocument.Show_Comment(Id);
3683
};
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
3684 3685 3686 3687 3688 3689 3690

asc_docs_api.prototype.can_AddQuotedComment = function()
{
    //if ( true === CollaborativeEditing.Get_GlobalLock() )
    //    return false;

    return this.WordControl.m_oLogicDocument.CanAdd_Comment();
3691
};
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
3692 3693 3694 3695

asc_docs_api.prototype.sync_RemoveComment = function(Id)
{
    this.asc_fireCallback("asc_onRemoveComment", Id);
3696
};
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
3697 3698 3699

asc_docs_api.prototype.sync_AddComment = function(Id, CommentData)
{
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
3700 3701 3702
    if(this.bNoSendComments === false)
    {
        var AscCommentData = new asc_CCommentData(CommentData);
3703
        AscCommentData.asc_putQuoteText("");
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
3704 3705
        this.asc_fireCallback("asc_onAddComment", Id, AscCommentData);
    }
3706
};
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
3707 3708 3709

asc_docs_api.prototype.sync_ShowComment = function(Id, X, Y)
{
Oleg.Korshul's avatar
Oleg.Korshul committed
3710
    /*
Oleg.Korshul's avatar
Oleg.Korshul committed
3711 3712 3713 3714
    if (this.WordControl.m_oMainContent)
    {
        X -= ((this.WordControl.m_oMainContent.Bounds.L * g_dKoef_mm_to_pix) >> 0);
    }
Oleg.Korshul's avatar
Oleg.Korshul committed
3715
    */
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
3716 3717
    // TODO: Переделать на нормальный массив
    this.asc_fireCallback("asc_onShowComment", [ Id ], X, Y);
3718
};
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
3719 3720 3721 3722

asc_docs_api.prototype.sync_HideComment = function()
{
    this.asc_fireCallback("asc_onHideComment");
3723
};
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
3724 3725 3726 3727 3728

asc_docs_api.prototype.sync_UpdateCommentPosition = function(Id, X, Y)
{
    // TODO: Переделать на нормальный массив
    this.asc_fireCallback("asc_onUpdateCommentPosition", [ Id ], X, Y);
3729
};
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
3730 3731 3732 3733 3734

asc_docs_api.prototype.sync_ChangeCommentData = function(Id, CommentData)
{
    var AscCommentData = new asc_CCommentData(CommentData);
    this.asc_fireCallback("asc_onChangeCommentData", Id, AscCommentData);
3735
};
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
3736 3737 3738 3739

asc_docs_api.prototype.sync_LockComment = function(Id, UserId)
{
    this.asc_fireCallback("asc_onLockComment", Id, UserId);
3740
};
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
3741 3742 3743 3744

asc_docs_api.prototype.sync_UnLockComment = function(Id)
{
    this.asc_fireCallback("asc_onUnLockComment", Id);
3745
};
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
3746

3747 3748 3749 3750 3751 3752
// работа с шрифтами
asc_docs_api.prototype.asyncFontsDocumentStartLoaded = function()
{
	// здесь прокинуть евент о заморозке меню
	// и нужно вывести информацию в статус бар
    if (this.isPasteFonts_Images)
Oleg.Korshul's avatar
Oleg.Korshul committed
3753
        this.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.LoadFont);
3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767
    else
    {
        this.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.LoadDocumentFonts);

        // заполним прогресс
        var _progress = this.OpenDocumentProgress;
        _progress.Type = c_oAscAsyncAction.LoadDocumentFonts;
        _progress.FontsCount = this.FontLoader.fonts_loading.length;
        _progress.CurrentFont = 0;

        var _loader_object = this.WordControl.m_oLogicDocument;
        var _count = 0;
        if (_loader_object !== undefined && _loader_object != null)
        {
3768 3769 3770
			for (var i in _loader_object.ImageMap) {
				if(this.DocInfo.get_OfflineApp()) {
					var localUrl = _loader_object.ImageMap[i];
Alexander.Trofimov's avatar
Alexander.Trofimov committed
3771
					g_oDocumentUrls.addImageUrl(localUrl, this.documentUrl + 'media/' + localUrl);
3772
				}
3773
                ++_count;
3774
			}
3775 3776
        }

3777
        _progress.ImagesCount = _count + AscCommon.g_oUserTexturePresets.length;
3778 3779
        _progress.CurrentImage = 0;
    }
3780
};
3781 3782 3783
asc_docs_api.prototype.GenerateStyles = function()
{
    return;
3784
};
3785 3786 3787 3788
asc_docs_api.prototype.asyncFontsDocumentEndLoaded = function()
{
    // все, шрифты загружены. Теперь нужно подгрузить картинки
    if (this.isPasteFonts_Images)
Oleg.Korshul's avatar
Oleg.Korshul committed
3789
        this.sync_EndAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.LoadFont);
3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802
    else
        this.sync_EndAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.LoadDocumentFonts);

    this.EndActionLoadImages = 0;
    if (this.isPasteFonts_Images)
    {
        var _count = 0;
        for (var i in this.pasteImageMap)
            ++_count;

        if (_count > 0)
        {
            this.EndActionLoadImages = 2;
Oleg.Korshul's avatar
Oleg.Korshul committed
3803
            this.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.LoadImage);
3804 3805 3806 3807 3808
        }

        this.ImageLoader.LoadDocumentImages(this.pasteImageMap, false);
        return;
    }
Oleg.Korshul's avatar
Oleg.Korshul committed
3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823
    else if (this.isSaveFonts_Images)
    {
        var _count = 0;
        for (var i in this.saveImageMap)
            ++_count;

        if (_count > 0)
        {
            this.EndActionLoadImages = 2;
            this.sync_StartAction(c_oAscAsyncActionType.Information, c_oAscAsyncAction.LoadImage);
        }

        this.ImageLoader.LoadDocumentImages(this.saveImageMap, false);
        return;
    }
3824 3825 3826 3827 3828 3829 3830

    this.GenerateStyles();
    // открытие после загрузки документа

    if (this.isLoadNoCutFonts)
    {
        this.isLoadNoCutFonts = false;
Alexander.Trofimov's avatar
Alexander.Trofimov committed
3831
        this.asc_setViewMode(false);
3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843
        return;
    }

	var _loader_object = this.WordControl.m_oLogicDocument;
	if (null == _loader_object)
		_loader_object = this.WordControl.m_oDrawingDocument.m_oDocumentRenderer;

    var _count = 0;
	for (var i in _loader_object.ImageMap)
        ++_count;

    // add const textures
3844
    var _st_count = AscCommon.g_oUserTexturePresets.length;
3845
    for (var i = 0; i < _st_count; i++)
3846
        _loader_object.ImageMap[_count + i] = AscCommon.g_oUserTexturePresets[i];
3847 3848 3849 3850 3851 3852 3853 3854 3855

    if (_count > 0)
    {
        this.EndActionLoadImages = 1;
        this.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.LoadDocumentImages);
    }

    this.ImageLoader.bIsLoadDocumentFirst = true;
	this.ImageLoader.LoadDocumentImages(_loader_object.ImageMap, true);
3856
};
3857 3858 3859
asc_docs_api.prototype.asyncImagesDocumentEndLoaded = function()
{
    this.ImageLoader.bIsLoadDocumentFirst = false;
Oleg.Korshul's avatar
Oleg.Korshul committed
3860
    var _bIsOldPaste = this.isPasteFonts_Images;
3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875
	
	if (this.EndActionLoadImages == 1)
    {
        this.sync_EndAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.LoadDocumentImages);
    }
    else if (this.EndActionLoadImages == 2)
    {
        if (_bIsOldPaste)
            this.sync_EndAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.LoadImage);
        else
            this.sync_EndAction(c_oAscAsyncActionType.Information, c_oAscAsyncAction.LoadImage);
    }

    this.EndActionLoadImages = 0;
	
3876
    // размораживаем меню... и начинаем считать документ
Oleg.Korshul's avatar
Oleg.Korshul committed
3877 3878 3879 3880
    if (this.isPasteFonts_Images)
    {
        this.isPasteFonts_Images = false;
        this.pasteImageMap = null;
3881
        this.decrementCounterLongAction();
Oleg.Korshul's avatar
Oleg.Korshul committed
3882
        this.pasteCallback();
Oleg.Korshul's avatar
Oleg.Korshul committed
3883
        window.GlobalPasteFlag = false;
Oleg.Korshul's avatar
Oleg.Korshul committed
3884
        window.GlobalPasteFlagCounter = 0;
Oleg.Korshul's avatar
Oleg.Korshul committed
3885 3886 3887 3888 3889 3890 3891 3892 3893
        this.pasteCallback = null;
    }
    else if (this.isSaveFonts_Images)
    {
        this.isSaveFonts_Images = false;
        this.saveImageMap = null;
        this.pre_SaveCallback();
    }
    else
3894 3895 3896 3897
    {
        this.ServerImagesWaitComplete = true;
        if (true == this.ServerIdWaitComplete)
            this.OpenDocumentEndCallback();
3898
    }    
3899
};
3900

Oleg.Korshul's avatar
Oleg.Korshul committed
3901 3902 3903 3904 3905 3906 3907 3908 3909 3910
asc_docs_api.prototype.asc_getComments = function()
{
    var comms = [];
    if (null == this.WordControl.m_oLogicDocument)
        return comms;

    var _slides = this.WordControl.m_oLogicDocument.Slides;
    var _slidesCount = _slides.length;
    for (var i = 0; i < _slidesCount; i++)
    {
Oleg.Korshul's avatar
Oleg.Korshul committed
3911
        var _comments = _slides[i].slideComments.comments;
Oleg.Korshul's avatar
Oleg.Korshul committed
3912 3913 3914 3915
        var _commentsCount = _comments.length;

        for (var j = 0; j < _commentsCount; j++)
        {
Oleg.Korshul's avatar
Oleg.Korshul committed
3916 3917 3918 3919
            var _id = _comments[j].Get_Id();
            var _ascCommentData = new asc_CCommentData(_comments[j].Data);

            comms.push({ "Id" : _id, "Comment" : _ascCommentData });
Oleg.Korshul's avatar
Oleg.Korshul committed
3920 3921 3922
        }
    }
    return comms;
3923
};
Oleg.Korshul's avatar
Oleg.Korshul committed
3924

3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938
asc_docs_api.prototype.OpenDocumentEndCallback = function()
{
    var bIsScroll = false;

    if (0 == this.DocumentType)
        this.WordControl.m_oLogicDocument.LoadEmptyDocument();
    else if (1 == this.DocumentType)
    {
        this.WordControl.m_oLogicDocument.LoadTestDocument();
    }
    else
    {
        if(this.LoadedObject)
        {
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
3939 3940
            if(this.LoadedObject === 1)
            {
Oleg.Korshul's avatar
Oleg.Korshul committed
3941 3942
                if (this.isApplyChangesOnOpenEnabled)
                {
Oleg.Korshul's avatar
Oleg.Korshul committed
3943
                    this.isApplyChangesOnOpenEnabled = false;
3944 3945
                    this.isApplyChangesOnOpen = true;
                    this.bNoSendComments = true;
3946 3947 3948
                    var OtherChanges = AscCommon.CollaborativeEditing.m_aChanges.length > 0 ;
                  AscCommon.CollaborativeEditing.Apply_Changes();
                  AscCommon.CollaborativeEditing.Release_Locks();
3949
                    this.bNoSendComments = false;
3950 3951 3952 3953

                    var _slides = this.WordControl.m_oLogicDocument.Slides;
                    var _slidesCount = _slides.length;
                    for (var i = 0; i < _slidesCount; i++)
3954
                    {
3955 3956
                        var slideComments = _slides[i].slideComments;
                        if(slideComments)
3957
                        {
3958 3959 3960
                            var _comments = slideComments.comments;
                            var _commentsCount = _comments.length;
                            for (var j = 0; j < _commentsCount; j++)
3961
                            {
3962
                                this.sync_AddComment(_comments[j].Get_Id(), _comments[j].Data );
3963 3964
                            }
                        }
3965 3966 3967 3968
                    }
                    this.bAddComments = true;
                    if(OtherChanges)
                    {
3969
                        return;
3970
                    }
Alexander.Trofimov's avatar
Alexander.Trofimov committed
3971 3972 3973 3974 3975 3976

                  // Применяем все lock-и (ToDo возможно стоит пересмотреть вообще Lock-и)
                  for (var i = 0; i < this.arrPreOpenLocksObjects.length; ++i) {
                    this.arrPreOpenLocksObjects[i]();
                  }
                  this.arrPreOpenLocksObjects = [];
Oleg.Korshul's avatar
Oleg.Korshul committed
3977
                }
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
3978
            }
3979
            this.WordControl.m_oLogicDocument.Recalculate({Drawings: {All:true, Map: {}}});
3980
            var presentation = this.WordControl.m_oLogicDocument;
Oleg.Korshul's avatar
Oleg.Korshul committed
3981

3982
            presentation.DrawingDocument.OnEndRecalculate();
Oleg.Korshul's avatar
Oleg.Korshul committed
3983

Oleg.Korshul's avatar
Oleg.Korshul committed
3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994
            this.WordControl.m_oLayoutDrawer.IsRetina = this.WordControl.bIsRetinaSupport;

            this.WordControl.m_oLayoutDrawer.WidthMM = presentation.Width;
            this.WordControl.m_oLayoutDrawer.HeightMM = presentation.Height;
            this.WordControl.m_oMasterDrawer.WidthMM = presentation.Width;
            this.WordControl.m_oMasterDrawer.HeightMM = presentation.Height;
            this.WordControl.m_oLogicDocument.GenerateThumbnails(this.WordControl.m_oMasterDrawer, this.WordControl.m_oLayoutDrawer);

            var _masters = this.WordControl.m_oLogicDocument.slideMasters;
            for (var i = 0; i < _masters.length; i++)
            {
3995 3996
                if(_masters[i].ThemeIndex < 0)//только темы презентации
                {
3997
                    var theme_load_info = new AscCommonSlide.CThemeLoadInfo();
3998 3999
                    theme_load_info.Master = _masters[i];
                    theme_load_info.Theme = _masters[i].Theme;
Oleg.Korshul's avatar
Oleg.Korshul committed
4000

4001 4002 4003
                    var _lay_cnt = _masters[i].sldLayoutLst.length;
                    for (var j = 0; j < _lay_cnt; j++)
                        theme_load_info.Layouts[j] = _masters[i].sldLayoutLst[j];
Oleg.Korshul's avatar
Oleg.Korshul committed
4004

4005
                    var th_info = {};
4006 4007 4008
                    th_info.Name = "Doc Theme " + i;
                    th_info.Url = "";
                    th_info.Thumbnail = _masters[i].ImageBase64;
Oleg.Korshul's avatar
Oleg.Korshul committed
4009

4010
                    var th = new AscCommonSlide.CAscThemeInfo(th_info);
4011 4012
                    this.ThemeLoader.Themes.DocumentThemes[this.ThemeLoader.Themes.DocumentThemes.length] = th;
                    th.Index = -this.ThemeLoader.Themes.DocumentThemes.length;
Oleg.Korshul's avatar
Oleg.Korshul committed
4013

4014 4015
                    this.ThemeLoader.themes_info_document[this.ThemeLoader.Themes.DocumentThemes.length - 1] = theme_load_info;
                }
Oleg.Korshul's avatar
Oleg.Korshul committed
4016 4017 4018 4019
            }

            this.sync_InitEditorThemes(this.ThemeLoader.Themes.EditorThemes, this.ThemeLoader.Themes.DocumentThemes);

4020
            this.asc_fireCallback("asc_onPresentationSize", presentation.Width, presentation.Height);
Oleg.Korshul's avatar
Oleg.Korshul committed
4021

4022 4023 4024 4025 4026
            this.WordControl.GoToPage(0);
            bIsScroll = true;
        }
    }

4027

4028 4029 4030 4031 4032 4033
    this.WordControl.m_oLogicDocument.Document_UpdateInterfaceState();
    this.WordControl.m_oLogicDocument.Document_UpdateRulersState();
    this.WordControl.m_oLogicDocument.Document_UpdateSelectionState();
    this.LoadedObject = null;

    this.bInit_word_control = true;
4034
    if(!(this.bAddComments === true) && !this.bNoSendComments)
Oleg.Korshul's avatar
Oleg.Korshul committed
4035
    {
4036 4037 4038
        var _slides = this.WordControl.m_oLogicDocument.Slides;
        var _slidesCount = _slides.length;
        for (var i = 0; i < _slidesCount; i++)
Oleg.Korshul's avatar
Oleg.Korshul committed
4039
        {
4040 4041
            var slideComments = _slides[i].slideComments;
            if(slideComments)
4042
            {
4043 4044 4045 4046 4047 4048
                var _comments = slideComments.comments;
                var _commentsCount = _comments.length;
                for (var j = 0; j < _commentsCount; j++)
                {
                    this.sync_AddComment(_comments[j].Get_Id(), _comments[j].Data );
                }
4049
            }
Oleg.Korshul's avatar
Oleg.Korshul committed
4050 4051
        }
    }
Oleg.Korshul's avatar
Oleg.Korshul committed
4052
    this.asc_fireCallback("asc_onDocumentContentReady");
4053 4054
    this.isApplyChangesOnOpen = false;
    this.bAddComments = false;
4055 4056 4057 4058 4059 4060
    this.WordControl.InitControl();
    if (bIsScroll)
    {
        this.WordControl.OnScroll();
    }

4061 4062
  if (!this.isViewMode) {
    this.sendStandartTextures();
4063 4064 4065
    if (this.shapeElementId) {
      this.WordControl.m_oDrawingDocument.InitGuiCanvasShape(this.shapeElementId);
    }
4066 4067
  }

4068
    if (this.isViewMode)
Alexander.Trofimov's avatar
Alexander.Trofimov committed
4069
        this.asc_setViewMode(true);
4070 4071

	// Меняем тип состояния (на никакое)
4072
	this.advancedOptionsAction = AscCommon.c_oAscAdvancedOptionsAction.None;
4073
};
4074 4075 4076 4077

asc_docs_api.prototype.asyncFontEndLoaded = function(fontinfo)
{
    this.sync_EndAction(c_oAscAsyncActionType.Information, c_oAscAsyncAction.LoadFont);
4078
    if(editor.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Drawing_Props) === false) {
4079
        History.Create_NewPoint(AscDFH.historydescription_Presentation_ParagraphAdd);
4080
        this.WordControl.m_oLogicDocument.Paragraph_Add(new AscCommonWord.ParaTextPr({FontFamily: {Name: fontinfo.Name, Index: -1}}));
4081
    }
4082
};
4083 4084 4085 4086 4087 4088 4089 4090

asc_docs_api.prototype.asyncImageEndLoaded = function(_image)
{
    // отжать заморозку меню
	if (this.asyncImageEndLoaded2)
		this.asyncImageEndLoaded2(_image);
	else
    {
4091
        this.WordControl.m_oLogicDocument.Add_FlowImage(50, 50, _image.src);
4092
	}
4093
};
4094

4095 4096 4097 4098 4099 4100 4101
asc_docs_api.prototype.openDocument = function(sData) {
  this.OpenDocument2(sData.url, sData.data);
  this.DocumentOrientation = (null == this.WordControl.m_oLogicDocument) ? true : !this.WordControl.m_oLogicDocument.Orientation;
  this.sync_DocSizeCallback(AscCommon.Page_Width, AscCommon.Page_Height);
  this.sync_PageOrientCallback(this.get_DocumentOrientation());
};

4102 4103 4104 4105 4106
asc_docs_api.prototype.get_PresentationWidth = function()
{
    if (this.WordControl.m_oLogicDocument == null)
        return 0;
    return this.WordControl.m_oLogicDocument.Width;
4107
};
4108 4109 4110 4111 4112
asc_docs_api.prototype.get_PresentationHeight = function()
{
    if (this.WordControl.m_oLogicDocument == null)
        return 0;
    return this.WordControl.m_oLogicDocument.Height;
4113
};
4114 4115 4116 4117 4118

asc_docs_api.prototype.pre_Paste = function(_fonts, _images, callback)
{
    this.pasteCallback = callback;
    this.pasteImageMap = _images;
Oleg.Korshul's avatar
Oleg.Korshul committed
4119 4120 4121 4122 4123 4124 4125 4126

    var _count = 0;
    for (var i in this.pasteImageMap)
        ++_count;
    if (0 == _count && false === this.FontLoader.CheckFontsNeedLoading(_fonts))
    {
        // никаких евентов. ничего грузить не нужно. сделано для сафари под макОс.
        // там при LongActions теряется фокус и вставляются пробелы
4127
        this.decrementCounterLongAction();
Oleg.Korshul's avatar
Oleg.Korshul committed
4128 4129
        this.pasteCallback();
        window.GlobalPasteFlag = false;
Oleg.Korshul's avatar
Oleg.Korshul committed
4130
        window.GlobalPasteFlagCounter = 0;
Oleg.Korshul's avatar
Oleg.Korshul committed
4131 4132 4133 4134 4135
        this.pasteCallback = null;
        return;
    }

    this.isPasteFonts_Images = true;
4136
    this.FontLoader.LoadDocumentFonts2(_fonts);
4137
};
4138

Oleg.Korshul's avatar
Oleg.Korshul committed
4139 4140
asc_docs_api.prototype.pre_SaveCallback = function()
{
4141
  AscCommon.CollaborativeEditing.OnEnd_Load_Objects();
Oleg.Korshul's avatar
Oleg.Korshul committed
4142 4143 4144 4145 4146 4147

    if (this.isApplyChangesOnOpen)
    {
        this.isApplyChangesOnOpen = false;
        this.OpenDocumentEndCallback();
    }
4148 4149

    this.WordControl.SlideDrawer.CheckRecalculateSlide();
4150
};
Oleg.Korshul's avatar
Oleg.Korshul committed
4151

4152 4153 4154
asc_docs_api.prototype.initEvents2MobileAdvances = function()
{
    this.WordControl.initEvents2MobileAdvances();
4155
};
4156 4157 4158
asc_docs_api.prototype.ViewScrollToX = function(x)
{
    this.WordControl.m_oScrollHorApi.scrollToX(x);
4159
};
4160 4161 4162
asc_docs_api.prototype.ViewScrollToY = function(y)
{
    this.WordControl.m_oScrollVerApi.scrollToY(y);
4163
};
4164 4165 4166
asc_docs_api.prototype.GetDocWidthPx = function()
{
    return this.WordControl.m_dDocumentWidth;
4167
};
4168 4169 4170
asc_docs_api.prototype.GetDocHeightPx = function()
{
    return this.WordControl.m_dDocumentHeight;
4171
};
4172 4173 4174
asc_docs_api.prototype.ClearSearch = function()
{
    return this.WordControl.m_oDrawingDocument.EndSearch(true);
4175
};
4176 4177 4178
asc_docs_api.prototype.GetCurrentVisiblePage = function()
{
    return this.WordControl.m_oDrawingDocument.SlideCurrent;
4179 4180
};

Oleg.Korshul's avatar
Oleg.Korshul committed
4181 4182 4183 4184
asc_docs_api.prototype.asc_SetDocumentPlaceChangedEnabled = function(bEnabled)
{
    if (this.WordControl)
        this.WordControl.m_bDocumentPlaceChangedEnabled = bEnabled;
4185
};
4186

Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
4187 4188 4189 4190 4191
asc_docs_api.prototype.asc_SetViewRulers = function(bRulers)
{
    //if (false === this.bInit_word_control || true === this.isViewMode)
    //    return;

4192 4193 4194 4195 4196
  if (!this.isLoadFullApi) {
    this.tmpViewRulers = bRulers;
    return;
  }

Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217
    if (this.WordControl.m_bIsRuler != bRulers)
    {
        this.WordControl.m_bIsRuler = bRulers;
        this.WordControl.checkNeedRules();
        this.WordControl.OnResize(true);
    }
};
asc_docs_api.prototype.asc_SetViewRulersChange = function()
{
    //if (false === this.bInit_word_control || true === this.isViewMode)
    //    return;

    this.WordControl.m_bIsRuler = !this.WordControl.m_bIsRuler;
    this.WordControl.checkNeedRules();
    this.WordControl.OnResize(true);
    return this.WordControl.m_bIsRuler;
};
asc_docs_api.prototype.asc_GetViewRulers = function()
{
    return this.WordControl.m_bIsRuler;
};
4218 4219 4220 4221 4222 4223
asc_docs_api.prototype.asc_SetDocumentUnits = function(_units)
{
    if (this.WordControl && this.WordControl.m_oHorRuler && this.WordControl.m_oVerRuler)
    {
        this.WordControl.m_oHorRuler.Units = _units;
        this.WordControl.m_oVerRuler.Units = _units;
4224 4225
        this.WordControl.UpdateHorRulerBack(true);
        this.WordControl.UpdateVerRulerBack(true);
4226 4227
    }
};
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
4228

4229 4230 4231 4232 4233
asc_docs_api.prototype.SetMobileVersion = function(val)
{
    this.isMobileVersion = val;
    if (this.isMobileVersion)
    {
Oleg.Korshul's avatar
Oleg.Korshul committed
4234 4235
        this.WordControl.bIsRetinaSupport = false; // ipad имеет проблемы с большими картинками
        this.WordControl.bIsRetinaNoSupportAttack = true;
4236 4237 4238
        this.WordControl.m_bIsRuler = false;
		this.ShowParaMarks = false;
    }
4239
};
4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253

asc_docs_api.prototype.GoToHeader = function(pageNumber)
{
    if (this.WordControl.m_oDrawingDocument.IsFreezePage(pageNumber))
        return;

    var oldClickCount = global_mouseEvent.ClickCount;
    global_mouseEvent.ClickCount = 2;
    this.WordControl.m_oLogicDocument.OnMouseDown(global_mouseEvent, 0, 0, pageNumber);
    this.WordControl.m_oLogicDocument.OnMouseUp(global_mouseEvent, 0, 0, pageNumber);

    this.WordControl.m_oLogicDocument.Document_UpdateInterfaceState();

    global_mouseEvent.ClickCount = oldClickCount;
4254
};
4255 4256 4257 4258

asc_docs_api.prototype.changeSlideSize = function(width, height)
{
    this.WordControl.m_oLogicDocument.changeSlideSize(width, height);
4259
};
4260 4261 4262 4263

asc_docs_api.prototype.AddSlide = function(layoutIndex)
{
    this.WordControl.m_oLogicDocument.addNextSlide(layoutIndex);
4264
};
4265 4266 4267
asc_docs_api.prototype.DeleteSlide = function()
{
    var _delete_array = this.WordControl.Thumbnails.GetSelectedArray();
Oleg.Korshul's avatar
Oleg.Korshul committed
4268 4269 4270 4271 4272 4273

    if (!this.IsSupportEmptyPresentation)
    {
        if (_delete_array.length == this.WordControl.m_oDrawingDocument.SlidesCount)
            _delete_array.splice(0, 1);
    }
4274 4275 4276 4277 4278

    if (_delete_array.length != 0)
    {
        this.WordControl.m_oLogicDocument.deleteSlides(_delete_array);
    }
4279
};
4280 4281
asc_docs_api.prototype.DublicateSlide = function()
{
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
4282
    this.WordControl.m_oLogicDocument.DublicateSlide();
4283
};
4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294

asc_docs_api.prototype.SelectAllSlides = function(layoutType)
{
    var drDoc = this.WordControl.m_oDrawingDocument;
    var slidesCount = drDoc.SlidesCount;

    for (var i = 0; i < slidesCount; i++)
    {
        this.WordControl.Thumbnails.m_arrPages[i].IsSelected = true;
    }
    this.WordControl.Thumbnails.OnUpdateOverlay();
4295
};
4296 4297 4298

asc_docs_api.prototype.AddShape = function(shapetype)
{
4299
};
4300 4301 4302
asc_docs_api.prototype.ChangeShapeType = function(shapetype)
{
    this.WordControl.m_oLogicDocument.changeShapeType(shapetype);
4303
};
4304 4305
asc_docs_api.prototype.AddText = function()
{
4306
};
4307 4308 4309 4310

asc_docs_api.prototype.groupShapes = function()
{
    this.WordControl.m_oLogicDocument.groupShapes();
4311
};
4312 4313 4314 4315

asc_docs_api.prototype.unGroupShapes = function()
{
    this.WordControl.m_oLogicDocument.unGroupShapes();
4316
};
4317 4318 4319 4320

asc_docs_api.prototype.setVerticalAlign = function(align)
{
    this.WordControl.m_oLogicDocument.setVerticalAlign(align);
4321
};
4322

4323 4324 4325 4326 4327
asc_docs_api.prototype.setVert = function(vert)
{
    this.WordControl.m_oLogicDocument.setVert(vert);
};

Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
4328 4329 4330
asc_docs_api.prototype.sync_MouseMoveStartCallback = function()
{
    this.asc_fireCallback("asc_onMouseMoveStart");
4331
};
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
4332 4333 4334 4335

asc_docs_api.prototype.sync_MouseMoveEndCallback = function()
{
    this.asc_fireCallback("asc_onMouseMoveEnd");
4336
};
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
4337 4338 4339

asc_docs_api.prototype.sync_MouseMoveCallback = function(Data)
{
4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373
    if(Data.Hyperlink && typeof Data.Hyperlink.Value === "string")
    {
        var indAction = Data.Hyperlink.Value.indexOf("ppaction://hlink");
        var Url = Data.Hyperlink.Value;
        if (0 == indAction)
        {
            if (Url == "ppaction://hlinkshowjump?jump=firstslide")
            {
                Data.Hyperlink.Value = "First Slide";
            }
            else if (Url == "ppaction://hlinkshowjump?jump=lastslide")
            {
                Data.Hyperlink.Value = "Last Slide";
            }
            else if (Url == "ppaction://hlinkshowjump?jump=nextslide")
            {
                Data.Hyperlink.Value = "Next Slide";
            }
            else if (Url == "ppaction://hlinkshowjump?jump=previousslide")
            {
                Data.Hyperlink.Value = "Previous Slide";
            }
            else
            {
                var mask = "ppaction://hlinksldjumpslide";
                var indSlide = Url.indexOf(mask);
                if (0 == indSlide)
                {
                    var slideNum = parseInt(Url.substring(mask.length));
                    Data.Hyperlink.Value = "Slide" + slideNum;
                }
            }
        }
    }
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
4374
    this.asc_fireCallback("asc_onMouseMove", Data );
4375
};
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
4376

4377 4378 4379
asc_docs_api.prototype.sync_ShowForeignCursorLabel = function(UserId, X, Y, Color)
{

4380
    this.asc_fireCallback("asc_onShowForeignCursorLabel", UserId, X, Y, new AscCommon.CColor(Color.r, Color.g, Color.b, 255));
4381 4382 4383 4384 4385 4386
};
asc_docs_api.prototype.sync_HideForeignCursorLabel = function(UserId)
{
    this.asc_fireCallback("asc_onHideForeignCursorLabel", UserId);
};

4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402
asc_docs_api.prototype.ShowThumbnails = function(bIsShow)
{
    if (bIsShow)
    {
        this.WordControl.Splitter1Pos = this.WordControl.OldSplitter1Pos;
        if (this.WordControl.Splitter1Pos == 0)
            this.WordControl.Splitter1Pos = 70;
        this.WordControl.OnResizeSplitter();
    }
    else
    {
        var old = this.WordControl.OldSplitter1Pos;
        this.WordControl.Splitter1Pos = 0;
        this.WordControl.OnResizeSplitter();
        this.WordControl.OldSplitter1Pos = old;
    }
4403
};
4404 4405 4406 4407
asc_docs_api.prototype.asc_DeleteVerticalScroll = function()
{
    this.WordControl.DeleteVerticalScroll();
};
4408 4409 4410 4411 4412 4413 4414 4415

asc_docs_api.prototype.syncOnThumbnailsShow = function()
{
    var bIsShow = true;
    if (0 == this.WordControl.Splitter1Pos)
        bIsShow = false;

    this.asc_fireCallback("asc_onThumbnailsShow", bIsShow);
4416
};
4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432



//-----------------------------------------------------------------
// Функции для работы с гиперссылками
//-----------------------------------------------------------------
asc_docs_api.prototype.can_AddHyperlink = function()
{
    //if ( true === CollaborativeEditing.Get_GlobalLock() )
    //    return false;

    var bCanAdd = this.WordControl.m_oLogicDocument.Hyperlink_CanAdd();
    if ( true === bCanAdd )
        return this.WordControl.m_oLogicDocument.Get_SelectedText(true);

    return false;
4433
};
4434 4435 4436 4437

// HyperProps - объект CHyperlinkProperty
asc_docs_api.prototype.add_Hyperlink = function(HyperProps)
{
4438
    this.WordControl.m_oLogicDocument.Hyperlink_Add( HyperProps );
4439
};
4440 4441 4442 4443

// HyperProps - объект CHyperlinkProperty
asc_docs_api.prototype.change_Hyperlink = function(HyperProps)
{
4444
    this.WordControl.m_oLogicDocument.Hyperlink_Modify( HyperProps );
4445
};
4446 4447 4448

asc_docs_api.prototype.remove_Hyperlink = function()
{
4449
    this.WordControl.m_oLogicDocument.Hyperlink_Remove();
4450
};
4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467

function CHyperlinkProperty( obj )
{
    if( obj )
    {
        this.Text    = (undefined != obj.Text   ) ? obj.Text    : null;
        this.Value   = (undefined != obj.Value  ) ? obj.Value   : "";
        this.ToolTip = (undefined != obj.ToolTip) ? obj.ToolTip : null;
    }
    else
    {
        this.Text    = null;
        this.Value   = "";
        this.ToolTip = null;
    }
}

4468 4469 4470
CHyperlinkProperty.prototype.get_Value   = function()  { return this.Value; };
CHyperlinkProperty.prototype.put_Value   = function(v) { this.Value = v; };
CHyperlinkProperty.prototype.get_ToolTip = function()  { return this.ToolTip; };
4471
CHyperlinkProperty.prototype.put_ToolTip = function(v) { this.ToolTip = v ? v.slice(0, Asc.c_oAscMaxTooltipLength) : v; };
4472 4473
CHyperlinkProperty.prototype.get_Text    = function()  { return this.Text; };
CHyperlinkProperty.prototype.put_Text    = function(v) { this.Text = v; };
4474 4475 4476

asc_docs_api.prototype.sync_HyperlinkPropCallback = function(hyperProp)
{
4477
    this.SelectedObjectsStack[this.SelectedObjectsStack.length] = new asc_CSelectedObject( c_oAscTypeSelectElement.Hyperlink, new CHyperlinkProperty( hyperProp ) );
4478
};
4479 4480 4481 4482

asc_docs_api.prototype.sync_HyperlinkClickCallback = function(Url)
{
    this.asc_fireCallback("asc_onHyperlinkClick", Url);
4483
};
4484 4485 4486 4487 4488 4489 4490

asc_docs_api.prototype.sync_CanAddHyperlinkCallback = function(bCanAdd)
{
    //if ( true === CollaborativeEditing.Get_GlobalLock() )
    //    this.asc_fireCallback("asc_onCanAddHyperlink", false);
    //else
    this.asc_fireCallback("asc_onCanAddHyperlink", bCanAdd);
4491
};
4492 4493 4494 4495

asc_docs_api.prototype.sync_DialogAddHyperlink = function()
{
    this.asc_fireCallback("asc_onDialogAddHyperlink");
4496
};
4497 4498 4499 4500 4501 4502 4503 4504 4505


asc_docs_api.prototype.GoToFooter = function(pageNumber)
{
    if (this.WordControl.m_oDrawingDocument.IsFreezePage(pageNumber))
        return;

    var oldClickCount = global_mouseEvent.ClickCount;
    global_mouseEvent.ClickCount = 2;
4506 4507
    this.WordControl.m_oLogicDocument.OnMouseDown(global_mouseEvent, 0, AscCommon.Page_Height, pageNumber);
    this.WordControl.m_oLogicDocument.OnMouseUp(global_mouseEvent, 0, AscCommon.Page_Height, pageNumber);
4508 4509 4510 4511

    this.WordControl.m_oLogicDocument.Document_UpdateInterfaceState();

    global_mouseEvent.ClickCount = oldClickCount;
4512
};
4513 4514
asc_docs_api.prototype.sync_shapePropCallback = function(pr)
{
4515
    var obj = AscFormat.CreateAscShapePropFromProp(pr);
4516
    if (pr.fill != null && pr.fill.fill != null && pr.fill.fill.type == c_oAscFill.FILL_TYPE_BLIP)
4517 4518 4519
    {
        this.WordControl.m_oDrawingDocument.DrawImageTextureFillShape(pr.fill.fill.RasterImageId);
    }
4520 4521 4522 4523
    else
    {
        this.WordControl.m_oDrawingDocument.DrawImageTextureFillShape(null);
    }
4524

4525
    var oTextArtProperties = pr.textArtProperties;
4526
    if(oTextArtProperties && oTextArtProperties.Fill && oTextArtProperties.Fill.fill  && oTextArtProperties.Fill.fill.type == c_oAscFill.FILL_TYPE_BLIP)
4527 4528 4529 4530 4531 4532 4533 4534 4535
    {
        this.WordControl.m_oDrawingDocument.DrawImageTextureFillTextArt(oTextArtProperties.Fill.fill.RasterImageId);
    }
    else
    {
        this.WordControl.m_oDrawingDocument.DrawImageTextureFillTextArt(null);
    }


4536 4537 4538 4539 4540 4541 4542 4543 4544 4545
    var _len = this.SelectedObjectsStack.length;
    if (_len > 0)
    {
        if (this.SelectedObjectsStack[_len - 1].Type == c_oAscTypeSelectElement.Shape)
        {
            this.SelectedObjectsStack[_len - 1].Value = obj;
            return;
        }
    }

4546
    this.SelectedObjectsStack[this.SelectedObjectsStack.length] = new asc_CSelectedObject( c_oAscTypeSelectElement.Shape, obj );
4547
};
4548 4549 4550

asc_docs_api.prototype.sync_slidePropCallback = function(slide)
{
Oleg.Korshul's avatar
Oleg.Korshul committed
4551 4552 4553
    if (!slide)
        return;

4554 4555
    var obj = new CAscSlideProps();

4556 4557 4558
    var bgFill = slide.backgroundFill;
  // if (slide.cSld && slide.cSld.Bg && slide.cSld.Bg.bgPr)
  //     bgFill = slide.cSld.Bg.bgPr.Fill;
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
4559 4560 4561

    if(!bgFill)
    {
4562
        obj.Background = new asc_CShapeFill();
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
4563
        obj.Background.type = c_oAscFill.FILL_TYPE_NOFILL;
4564 4565

        this.WordControl.m_oDrawingDocument.DrawImageTextureFillSlide(null);
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
4566 4567 4568
    }
    else
    {
4569
        obj.Background = AscFormat.CreateAscFill(bgFill);
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
4570

4571
        if (bgFill != null && bgFill.fill != null && bgFill.fill.type == c_oAscFill.FILL_TYPE_BLIP)
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
4572 4573 4574
        {
            this.WordControl.m_oDrawingDocument.DrawImageTextureFillSlide(bgFill.fill.RasterImageId);
        }
4575 4576 4577 4578
        else
        {
            this.WordControl.m_oDrawingDocument.DrawImageTextureFillSlide(null);
        }
4579 4580
    }

Oleg.Korshul's avatar
Oleg.Korshul committed
4581
    obj.Timing = slide.timing;
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
4582 4583 4584 4585 4586
    obj.lockDelete = !(slide.deleteLock.Lock.Type === locktype_Mine || slide.deleteLock.Lock.Type === locktype_None);
    obj.lockLayout = !(slide.layoutLock.Lock.Type === locktype_Mine || slide.layoutLock.Lock.Type === locktype_None);
    obj.lockTiming = !(slide.timingLock.Lock.Type === locktype_Mine || slide.timingLock.Lock.Type === locktype_None);
    obj.lockTranzition = !(slide.transitionLock.Lock.Type === locktype_Mine || slide.transitionLock.Lock.Type === locktype_None);
    obj.lockBackground = !(slide.backgroundLock.Lock.Type === locktype_Mine || slide.backgroundLock.Lock.Type === locktype_None);
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
4587 4588 4589 4590 4591 4592
    obj.lockRemove = obj.lockDelete ||
    obj.lockLayout ||
    obj.lockTiming ||
    obj.lockTranzition ||
        obj.lockBackground ||slide.isLockedObject() ;

Oleg.Korshul's avatar
Oleg.Korshul committed
4593

4594 4595 4596 4597 4598 4599 4600 4601 4602 4603
    var _len = this.SelectedObjectsStack.length;
    if (_len > 0)
    {
        if (this.SelectedObjectsStack[_len - 1].Type == c_oAscTypeSelectElement.Slide)
        {
            this.SelectedObjectsStack[_len - 1].Value = obj;
            return;
        }
    }

4604
    this.SelectedObjectsStack[this.SelectedObjectsStack.length] = new asc_CSelectedObject( c_oAscTypeSelectElement.Slide, obj );
4605
};
4606 4607 4608 4609 4610 4611 4612 4613

asc_docs_api.prototype.ExitHeader_Footer = function(pageNumber)
{
    if (this.WordControl.m_oDrawingDocument.IsFreezePage(pageNumber))
        return;

    var oldClickCount = global_mouseEvent.ClickCount;
    global_mouseEvent.ClickCount = 2;
4614 4615
    this.WordControl.m_oLogicDocument.OnMouseDown(global_mouseEvent, 0, AscCommon.Page_Height / 2, pageNumber);
    this.WordControl.m_oLogicDocument.OnMouseUp(global_mouseEvent, 0, AscCommon.Page_Height / 2, pageNumber);
4616 4617 4618 4619

    this.WordControl.m_oLogicDocument.Document_UpdateInterfaceState();
    
    global_mouseEvent.ClickCount = oldClickCount;
4620
};
4621 4622 4623 4624

asc_docs_api.prototype.GetCurrentPixOffsetY = function()
{
    return this.WordControl.m_dScrollY;
4625
};
4626 4627 4628 4629 4630

asc_docs_api.prototype.SetPaintFormat = function(value)
{
    this.isPaintFormat = value;
    this.WordControl.m_oLogicDocument.Document_Format_Copy();
4631
};
4632 4633 4634 4635 4636

asc_docs_api.prototype.sync_PaintFormatCallback = function(value)
{
    this.isPaintFormat = value;
    return this.asc_fireCallback("asc_onPaintFormatChanged", value);
4637
};
4638 4639 4640
asc_docs_api.prototype.ClearFormating = function()
{
    this.WordControl.m_oLogicDocument.Paragraph_ClearFormatting();
4641
};
4642 4643 4644

window.ID_KEYBOARD_AREA = undefined;
window.ID_KEYBOARD_AREA;
4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658
asc_docs_api.prototype.SetDeviceInputHelperId = function(idKeyboard)
{
    if (window.ID_KEYBOARD_AREA === undefined && this.WordControl.m_oMainView != null)
    {
        window.ID_KEYBOARD_AREA = document.getElementById(idKeyboard);

        window.ID_KEYBOARD_AREA.onkeypress = function(e){
            if (false === editor.WordControl.IsFocus)
            {
                editor.WordControl.IsFocus = true;
                var ret = editor.WordControl.onKeyPress(e);
                editor.WordControl.IsFocus = false;
                return ret;
            }
Alexander.Trofimov's avatar
Alexander.Trofimov committed
4659
        };
4660 4661 4662 4663 4664 4665 4666 4667
        window.ID_KEYBOARD_AREA.onkeydown = function(e){
            if (false === editor.WordControl.IsFocus)
            {
                editor.WordControl.IsFocus = true;
                var ret = editor.WordControl.onKeyDown(e);
                editor.WordControl.IsFocus = false;
                return ret;
            }
Alexander.Trofimov's avatar
Alexander.Trofimov committed
4668
        };
4669 4670
    }
    window.ID_KEYBOARD_AREA.focus();
4671
};
4672 4673 4674
asc_docs_api.prototype.getViewMode = function() {
  return this.isViewMode;
};
Alexander.Trofimov's avatar
Alexander.Trofimov committed
4675
asc_docs_api.prototype.asc_setViewMode = function(isViewMode) {
4676 4677 4678 4679 4680
  if (!this.isLoadFullApi) {
    this.isViewMode = isViewMode;
    return;
  }

4681 4682 4683 4684 4685 4686
  if (isViewMode) {
    this.isViewMode = true;
    this.ShowParaMarks = false;
    this.WordControl.m_bIsRuler = false;
    this.WordControl.m_oDrawingDocument.ClearCachePages();
    this.WordControl.HideRulers();
4687

4688 4689 4690 4691 4692 4693 4694 4695 4696
    if (null != this.WordControl.m_oLogicDocument) {
      this.WordControl.m_oLogicDocument.viewMode = true;
    }
  } else {
    if (this.bInit_word_control === true && this.FontLoader.embedded_cut_manager.bIsCutFontsUse) {
      this.isLoadNoCutFonts = true;
      this.FontLoader.embedded_cut_manager.bIsCutFontsUse = false;
      this.FontLoader.LoadDocumentFonts(this.WordControl.m_oLogicDocument.Fonts, true);
      return;
4697
    }
4698

4699
    if (this.bInit_word_control === true) {
4700 4701
      AscCommon.CollaborativeEditing.Apply_Changes();
      AscCommon.CollaborativeEditing.Release_Locks();
4702
    }
4703

4704
    this.isUseEmbeddedCutFonts = false;
4705

4706 4707 4708 4709
    this.isViewMode = false;
    this.WordControl.checkNeedRules();
    this.WordControl.m_oDrawingDocument.ClearCachePages();
    this.WordControl.OnResize(true);
4710

4711 4712
    if (null != this.WordControl.m_oLogicDocument) {
      this.WordControl.m_oLogicDocument.viewMode = false;
4713
    }
4714
  }
4715
};
4716 4717 4718 4719

asc_docs_api.prototype.SetUseEmbeddedCutFonts = function(bUse)
{
    this.isUseEmbeddedCutFonts = bUse;
4720
};
4721 4722 4723 4724 4725 4726 4727 4728

asc_docs_api.prototype.can_AddHyperlink = function()
{
    var bCanAdd = this.WordControl.m_oLogicDocument.Hyperlink_CanAdd();
    if ( true === bCanAdd )
        return this.WordControl.m_oLogicDocument.Get_SelectedText(true);

    return false;
4729
};
4730 4731 4732
asc_docs_api.prototype.add_Hyperlink = function(HyperProps)
{
        this.WordControl.m_oLogicDocument.Hyperlink_Add( HyperProps );
4733
};
4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769
asc_docs_api.prototype.sync_HyperlinkClickCallback = function(Url)
{
    var indAction = Url.indexOf("ppaction://hlink");
    if (0 == indAction)
    {
        if (Url == "ppaction://hlinkshowjump?jump=firstslide")
        {
            this.WordControl.GoToPage(0);
        }
        else if (Url == "ppaction://hlinkshowjump?jump=lastslide")
        {
            this.WordControl.GoToPage(this.WordControl.m_oDrawingDocument.SlidesCount - 1);
        }
        else if (Url == "ppaction://hlinkshowjump?jump=nextslide")
        {
            this.WordControl.onNextPage();
        }
        else if (Url == "ppaction://hlinkshowjump?jump=previousslide")
        {
            this.WordControl.onPrevPage();
        }
        else
        {
            var mask = "ppaction://hlinksldjumpslide";
            var indSlide = Url.indexOf(mask);
            if (0 == indSlide)
            {
                var slideNum = parseInt(Url.substring(mask.length));
                if (slideNum >= 0 && slideNum < this.WordControl.m_oDrawingDocument.SlidesCount)
                    this.WordControl.GoToPage(slideNum);
            }
        }
        return;
    }

    this.asc_fireCallback("asc_onHyperlinkClick", Url);
4770
};
4771 4772 4773 4774 4775 4776 4777 4778

asc_docs_api.prototype.UpdateInterfaceState = function()
{
    if (this.WordControl.m_oLogicDocument != null)
    {
        this.WordControl.m_oLogicDocument.Document_UpdateInterfaceState();
        this.WordControl.CheckLayouts(true);
    }
4779
};
4780 4781 4782

asc_docs_api.prototype.OnMouseUp = function(x, y)
{
Alexander.Trofimov's avatar
Alexander.Trofimov committed
4783 4784
    var _e = AscCommon.CreateMouseUpEventObject(x, y);
  AscCommon.Window_OnMouseUp(_e);
4785 4786

    //this.WordControl.onMouseUpExternal(x, y);
4787
};
Oleg.Korshul's avatar
Oleg.Korshul committed
4788

4789 4790 4791 4792
asc_docs_api.prototype.asyncImageEndLoaded2 = null;

asc_docs_api.prototype.ChangeTheme = function(indexTheme)
{
4793
    if (true === AscCommon.CollaborativeEditing.Get_GlobalLock())
Oleg.Korshul's avatar
 
Oleg.Korshul committed
4794 4795
        return;

4796
    if (!this.isViewMode && this.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(AscCommon.changestype_Theme) === false)
Oleg.Korshul's avatar
Oleg.Korshul committed
4797
    {
4798
      AscCommon.CollaborativeEditing.m_bGlobalLock = true;
4799
        this.WordControl.m_oLogicDocument.Create_NewHistoryPoint(AscDFH.historydescription_Presentation_ChangeTheme);
Oleg.Korshul's avatar
Oleg.Korshul committed
4800 4801
        this.ThemeLoader.StartLoadTheme(indexTheme);
    }
4802
};
4803 4804 4805

asc_docs_api.prototype.StartLoadTheme = function()
{
4806
};
4807 4808
asc_docs_api.prototype.EndLoadTheme = function(theme_load_info)
{
4809
  AscCommon.CollaborativeEditing.m_bGlobalLock = false;
Oleg.Korshul's avatar
 
Oleg.Korshul committed
4810

4811 4812
    // применение темы
    var _array = this.WordControl.Thumbnails.GetSelectedArray();
4813
    this.WordControl.m_oLogicDocument.changeTheme(theme_load_info, _array.length <= 1 ? null : _array);
Oleg.Korshul's avatar
Oleg.Korshul committed
4814
    this.WordControl.ThemeGenerateThumbnails(theme_load_info.Master);
4815 4816
    // меняем шаблоны в меню
    this.WordControl.CheckLayouts();
Oleg.Korshul's avatar
Oleg.Korshul committed
4817 4818

    this.sync_EndAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.LoadTheme);
4819
};
4820 4821 4822 4823 4824 4825 4826

asc_docs_api.prototype.ChangeLayout = function(layout_index)
{
    var _array = this.WordControl.Thumbnails.GetSelectedArray();

    var _master = this.WordControl.MasterLayouts;
    this.WordControl.m_oLogicDocument.changeLayout(_array, this.WordControl.MasterLayouts, layout_index);
4827
};
4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926

asc_docs_api.prototype.put_ShapesAlign = function(type)
{
    switch (type)
    {
        case c_oAscAlignShapeType.ALIGN_LEFT:
        {
            this.shapes_alignLeft();
            break;
        }
        case c_oAscAlignShapeType.ALIGN_RIGHT:
        {
            this.shapes_alignRight();
            break;
        }
        case c_oAscAlignShapeType.ALIGN_TOP:
        {
            this.shapes_alignTop();
            break;
        }
        case c_oAscAlignShapeType.ALIGN_BOTTOM:
        {
            this.shapes_alignBottom();
            break;
        }
        case c_oAscAlignShapeType.ALIGN_CENTER:
        {
            this.shapes_alignCenter();
            break;
        }
        case c_oAscAlignShapeType.ALIGN_MIDDLE:
        {
            this.shapes_alignMiddle();
            break;
        }
        default:
            break;
    }
};
asc_docs_api.prototype.DistributeHorizontally = function()
{
    this.WordControl.m_oLogicDocument.distributeHor();
};
asc_docs_api.prototype.DistributeVertically = function()
{
    this.WordControl.m_oLogicDocument.distributeVer();
};
asc_docs_api.prototype.shapes_alignLeft = function()
{
    this.WordControl.m_oLogicDocument.alignLeft();
};

asc_docs_api.prototype.shapes_alignRight = function()
{
    this.WordControl.m_oLogicDocument.alignRight();
};

asc_docs_api.prototype.shapes_alignTop = function()
{
    this.WordControl.m_oLogicDocument.alignTop();

};

asc_docs_api.prototype.shapes_alignBottom = function()
{
    this.WordControl.m_oLogicDocument.alignBottom();

};

asc_docs_api.prototype.shapes_alignCenter = function()
{
    this.WordControl.m_oLogicDocument.alignCenter();
};

asc_docs_api.prototype.shapes_alignMiddle = function()
{
    this.WordControl.m_oLogicDocument.alignMiddle();
};

asc_docs_api.prototype.shapes_bringToFront = function()
{
    this.WordControl.m_oLogicDocument.bringToFront();
};

asc_docs_api.prototype.shapes_bringForward = function()
{
    this.WordControl.m_oLogicDocument.bringForward();
};

asc_docs_api.prototype.shapes_bringToBack = function()
{
    this.WordControl.m_oLogicDocument.sendToBack();
};

asc_docs_api.prototype.shapes_bringBackward = function()
{
    this.WordControl.m_oLogicDocument.bringBackward();
};

Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
4927 4928 4929 4930
asc_docs_api.prototype.asc_setLoopShow = function(isLoop){
    this.WordControl.m_oLogicDocument.setShowLoop(isLoop);
};

4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941
asc_docs_api.prototype.sync_endDemonstration = function()
{
    this.asc_fireCallback("asc_onEndDemonstration");
};
asc_docs_api.prototype.sync_DemonstrationSlideChanged = function(slideNum)
{
    this.asc_fireCallback("asc_onDemonstrationSlideChanged", slideNum);
};

asc_docs_api.prototype.StartDemonstration = function(div_id, slidestart_num)
{
Oleg.Korshul's avatar
Oleg.Korshul committed
4942
    this.WordControl.DemonstrationManager.Start(div_id, slidestart_num, true);
4943
};
4944

Oleg.Korshul's avatar
Oleg.Korshul committed
4945
asc_docs_api.prototype.EndDemonstration = function(isNoUseFullScreen)
4946
{
Oleg.Korshul's avatar
Oleg.Korshul committed
4947
    this.WordControl.DemonstrationManager.End(isNoUseFullScreen);
4948
};
4949 4950 4951

asc_docs_api.prototype.DemonstrationPlay = function()
{
Oleg.Korshul's avatar
Oleg.Korshul committed
4952
    this.WordControl.DemonstrationManager.Play();
4953
};
4954 4955 4956

asc_docs_api.prototype.DemonstrationPause = function()
{
Oleg.Korshul's avatar
Oleg.Korshul committed
4957
    this.WordControl.DemonstrationManager.Pause();
4958
};
4959 4960 4961

asc_docs_api.prototype.DemonstrationEndShowMessage = function(message)
{
Oleg.Korshul's avatar
Oleg.Korshul committed
4962
    this.WordControl.DemonstrationManager.EndShowMessage = message;
4963
};
4964 4965 4966

asc_docs_api.prototype.DemonstrationNextSlide = function()
{
Oleg.Korshul's avatar
Oleg.Korshul committed
4967
    this.WordControl.DemonstrationManager.NextSlide();
4968
};
4969 4970 4971

asc_docs_api.prototype.DemonstrationPrevSlide = function()
{
Oleg.Korshul's avatar
Oleg.Korshul committed
4972
    this.WordControl.DemonstrationManager.PrevSlide();
4973
};
4974

Oleg.Korshul's avatar
Oleg.Korshul committed
4975
asc_docs_api.prototype.DemonstrationGoToSlide = function(slideNum)
4976
{
Oleg.Korshul's avatar
Oleg.Korshul committed
4977
    this.WordControl.DemonstrationManager.GoToSlide(slideNum);
4978
};
4979

Oleg.Korshul's avatar
Oleg.Korshul committed
4980 4981
asc_docs_api.prototype.ApplySlideTiming = function(oTiming)
{
4982
    if(this.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(AscCommon.changestype_SlideTiming) === false)
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
4983
    {
4984
        History.Create_NewPoint(AscDFH.historydescription_Presentation_ApplyTiming);
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
4985 4986 4987 4988 4989 4990 4991 4992
        var _count = this.WordControl.m_oDrawingDocument.SlidesCount;
        var _cur = this.WordControl.m_oDrawingDocument.SlideCurrent;
        if (_cur < 0 || _cur >= _count)
            return;
        var _curSlide = this.WordControl.m_oLogicDocument.Slides[_cur];
        _curSlide.applyTiming(oTiming);
    }
    this.WordControl.m_oLogicDocument.Document_UpdateInterfaceState();
4993
};
Oleg.Korshul's avatar
Oleg.Korshul committed
4994 4995 4996
asc_docs_api.prototype.SlideTimingApplyToAll = function()
{

4997
    if(this.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(AscCommon.changestype_SlideTiming, {All: true}) === false)
Oleg.Korshul's avatar
Oleg.Korshul committed
4998
    {
4999
        History.Create_NewPoint(AscDFH.historydescription_Presentation_ApplyTimingToAll);
5000 5001 5002 5003 5004 5005 5006 5007 5008
        var _count = this.WordControl.m_oDrawingDocument.SlidesCount;
        var _cur = this.WordControl.m_oDrawingDocument.SlideCurrent;
        var _slides = this.WordControl.m_oLogicDocument.Slides;
        if (_cur < 0 || _cur >= _count)
            return;
        var _curSlide = _slides[_cur];

        _curSlide.timing.makeDuplicate(this.WordControl.m_oLogicDocument.DefaultSlideTiming);
        var _default = this.WordControl.m_oLogicDocument.DefaultSlideTiming;
Oleg.Korshul's avatar
Oleg.Korshul committed
5009

5010 5011 5012 5013 5014 5015 5016
        for (var i = 0; i < _count; i++)
        {
            if (i == _cur)
                continue;

            _slides[i].applyTiming(_default);
        }
Oleg.Korshul's avatar
Oleg.Korshul committed
5017
    }
5018
};
Oleg.Korshul's avatar
Oleg.Korshul committed
5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031
asc_docs_api.prototype.SlideTransitionPlay = function()
{
    var _count = this.WordControl.m_oDrawingDocument.SlidesCount;
    var _cur = this.WordControl.m_oDrawingDocument.SlideCurrent;
    if (_cur < 0 || _cur >= _count)
        return;
    var _timing = this.WordControl.m_oLogicDocument.Slides[_cur].timing;

    var _tr     = this.WordControl.m_oDrawingDocument.TransitionSlide;
    _tr.Type    = _timing.TransitionType;
    _tr.Param   = _timing.TransitionOption;
    _tr.Duration = _timing.TransitionDuration;

Oleg.Korshul's avatar
Oleg.Korshul committed
5032
    _tr.Start(true);
5033
};
Oleg.Korshul's avatar
Oleg.Korshul committed
5034

5035 5036 5037
asc_docs_api.prototype.SetTextBoxInputMode = function(bIsEA)
{
    this.WordControl.SetTextBoxMode(bIsEA);
5038
};
5039 5040 5041
asc_docs_api.prototype.GetTextBoxInputMode = function()
{
    return this.WordControl.TextBoxInputMode;
5042
};
5043 5044 5045 5046 5047 5048 5049 5050

asc_docs_api.prototype.sync_EndAddShape = function()
{
    editor.asc_fireCallback("asc_onEndAddShape");
    if (this.WordControl.m_oDrawingDocument.m_sLockedCursorType == "crosshair")
    {
        this.WordControl.m_oDrawingDocument.UnlockCursorType();
    }
5051
};
5052

Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
5053
// Вставка диаграмм
5054
asc_docs_api.prototype.asc_getChartObject = function(type)
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
5055 5056
{
    this.isChartEditor = true;		// Для совместного редактирования
5057
    return this.WordControl.m_oLogicDocument.Get_ChartObject(type);
5058
};
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
5059 5060 5061 5062 5063 5064

asc_docs_api.prototype.asc_addChartDrawingObject = function(chartBinary)
{
    /**/

    // Приводим бинарик к объекту типа CChartAsGroup и добавляем объект
5065
    if ( AscFormat.isObject(chartBinary) )
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
5066
    {
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
5067
        //if ( false === this.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Drawing_Props) )
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
5068
        {
5069
            this.WordControl.m_oLogicDocument.addChart(chartBinary);
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
5070 5071
        }
    }
5072
};
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
5073 5074 5075 5076 5077 5078

asc_docs_api.prototype.asc_editChartDrawingObject = function(chartBinary)
{
    /**/

    // Находим выделенную диаграмму и накатываем бинарник
5079
    if ( AscCommon.isRealObject(chartBinary) )
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
5080
    {
5081
        this.WordControl.m_oLogicDocument.Edit_Chart(chartBinary["binary"]);
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
5082
    }
5083
};
Sergey.Luzyanin's avatar
Sergey.Luzyanin committed
5084 5085 5086 5087

asc_docs_api.prototype.sync_closeChartEditor = function()
{
    this.asc_fireCallback("asc_onCloseChartEditor");
5088 5089
};

5090 5091 5092 5093
//-----------------------------------------------------------------
// События контекстного меню
//-----------------------------------------------------------------

5094
function CContextMenuData(oData)
5095
{
5096
    if(AscCommon.isRealObject(oData))
5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109
    {
        this.Type  = oData.Type;
        this.X_abs = oData.X_abs;
        this.Y_abs = oData.Y_abs;
        this.IsSlideSelect = oData.IsSlideSelect;
    }
    else
    {
        this.Type  = c_oAscContextMenuTypes.Main;
        this.X_abs = 0;
        this.Y_abs = 0;
        this.IsSlideSelect = true;
    }
5110 5111
}

5112 5113 5114 5115
CContextMenuData.prototype.get_Type  = function()  { return this.Type; };
CContextMenuData.prototype.get_X = function()  { return this.X_abs; };
CContextMenuData.prototype.get_Y = function()  { return this.Y_abs; };
CContextMenuData.prototype.get_IsSlideSelect = function()  { return this.IsSlideSelect; };
5116 5117 5118 5119

asc_docs_api.prototype.sync_ContextMenuCallback = function(Data)
{
    this.asc_fireCallback("asc_onContextMenu", Data);
5120
};
5121

5122 5123
asc_docs_api.prototype._onOpenCommand = function(data) {
  var t = this;
5124
  AscCommon.openFileCommand(data, this.documentUrlChanges, AscCommon.c_oSerFormat.Signature, function (error, result) {
5125
		if (error || !result.bSerFormat) {
5126
			t.asc_fireCallback("asc_onError",c_oAscError.ID.Unknown,c_oAscError.Level.Critical);
5127
			return;
5128
		}
5129
    t.onEndLoadFile(result);
5130
	});
5131
};
5132
asc_docs_api.prototype._onEndLoadSdk = function() {
5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164
  History = AscCommon.History;
  PasteElementsId = AscCommon.PasteElementsId;
  global_mouseEvent = AscCommon.global_mouseEvent;

  g_oTableId.init();
  this.WordControl = new AscCommonSlide.CEditorPage(this);
  this.WordControl.Name = this.HtmlElementName;

  this.ThemeLoader = new AscCommonSlide.CThemeLoader();
  this.ThemeLoader.Api = this;

  //выставляем тип copypaste
  PasteElementsId.g_bIsDocumentCopyPaste = false;

  this.CreateComponents();
  this.WordControl.Init();

  if (this.tmpThemesPath) {
    this.SetThemesPath(this.tmpThemesPath);
  }
  if (null !== this.tmpIsFreeze) {
    this.SetDrawingFreeze(this.tmpIsFreeze);
  }
  if (this.tmpSlideDiv) {
    this.SetInterfaceDrawImagePlaceSlide(this.tmpSlideDiv);
  }
  if (this.tmpTextArtDiv) {
    this.SetInterfaceDrawImagePlaceTextArt(this.tmpTextArtDiv);
  }
  if (null !== this.tmpViewRulers) {
    this.asc_SetViewRulers(this.tmpViewRulers);
  }
Alexander.Trofimov's avatar
Alexander.Trofimov committed
5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177
  if (null !== this.tmpZoomType) {
    switch(this.tmpZoomType) {
      case AscCommon.c_oZoomType.FitToPage:
        this.zoomFitToPage();
        break;
      case AscCommon.c_oZoomType.FitToWidth:
        this.zoomFitToWidth();
        break;
      case AscCommon.c_oZoomType.CustomMode:
        this.zoomCustomMode();
        break;
    }
  }
5178 5179 5180

  this.asc_setViewMode(this.isViewMode);

5181 5182 5183
  asc_docs_api.superclass._onEndLoadSdk.call(this);
};

5184
asc_docs_api.prototype._downloadAs = function(filetype, actionType, options)
5185
{
5186
  var t = this;
5187 5188 5189 5190
    if (!options) {
      options = {};
    }
    if (actionType) {
5191
      this.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, actionType);
5192 5193
    }
    
5194
	var dataContainer = {data: null, part: null, index: 0, count: 0};
5195
    var command = "save";
5196
	var oAdditionalData = {};
5197
	oAdditionalData["c"] = command;
5198 5199 5200
	oAdditionalData["id"] = this.documentId;
	oAdditionalData["userid"] = this.documentUserId;
	oAdditionalData["vkey"] = this.documentVKey;
5201
	oAdditionalData["outputformat"] = filetype;
5202
	oAdditionalData["title"] = AscCommon.changeFileExtention(this.documentTitle, AscCommon.getExtentionByFormat(filetype));
5203
	oAdditionalData["savetype"] = AscCommon.c_oAscSaveTypes.CompleteAll;
5204 5205 5206
    if (DownloadType.Print === options.downloadType) {
      oAdditionalData["inline"] = 1;
    }
5207 5208
	if(c_oAscFileType.PDF == filetype)
	{
5209
		var dd = this.WordControl.m_oDrawingDocument;
5210
		dataContainer.data = dd.ToRendererPart();
5211 5212
	}
	else
5213
		dataContainer.data = this.WordControl.SaveDocument();
5214
    var fCallback = function(input) {
5215
      var error = c_oAscError.ID.Unknown;
5216 5217 5218 5219
      if(null != input && command == input["type"]) {
        if('ok' == input["status"]){
          var url = input["data"];
          if(url) {
5220
            error = c_oAscError.ID.No;
5221
            t.processSavedFile(url, options.downloadType);
5222 5223
          }
        } else {
5224
          error = mapAscServerErrorToAscError(parseInt(input["data"]));
5225 5226
        }
      }
5227
      if (c_oAscError.ID.No != error) {
5228
        t.asc_fireCallback("asc_onError", error, c_oAscError.Level.NoCritical);
5229 5230
      }
      if (actionType) {
5231
        t.sync_EndAction(c_oAscAsyncActionType.BlockInteraction, actionType);
5232 5233
      }
    };
5234 5235
  this.fCurCallback = fCallback;
  AscCommon.saveWithParts(function(fCallback1, oAdditionalData1, dataContainer1){sendCommand(t, fCallback1, oAdditionalData1, dataContainer1);}, fCallback, null, oAdditionalData, dataContainer);
5236
};
5237

Oleg.Korshul's avatar
Oleg.Korshul committed
5238 5239
//test
window["asc_docs_api"] = asc_docs_api;
5240
window["asc_docs_api"].prototype["asc_nativeOpenFile"] = function(base64File, version)
Oleg.Korshul's avatar
Oleg.Korshul committed
5241
{
5242
	this.SpellCheckUrl = '';
5243

5244
	this.User = new AscCommon.asc_CUser();
Alexander.Trofimov's avatar
Alexander.Trofimov committed
5245 5246
	this.User.setId("TM");
	this.User.setUserName("native");
Oleg.Korshul's avatar
Oleg.Korshul committed
5247 5248 5249 5250 5251 5252 5253 5254
	
	this.WordControl.m_bIsRuler = false;
	this.WordControl.Init();
	
	this.InitEditor();
	
	g_oIdCounter.Set_Load(true);

5255
    var _loader = new AscCommon.BinaryPPTYLoader();
Oleg.Korshul's avatar
Oleg.Korshul committed
5256
    _loader.Api = this;
5257 5258 5259

    if (version === undefined)
    {
Oleg.Korshul's avatar
Oleg.Korshul committed
5260 5261
        _loader.Load(base64File, this.WordControl.m_oLogicDocument);
        _loader.Check_TextFit();
5262 5263 5264
    }
    else
    {
Oleg.Korshul's avatar
Oleg.Korshul committed
5265 5266
        _loader.Load2(base64File, this.WordControl.m_oLogicDocument);
        _loader.Check_TextFit();
5267
    }
Oleg.Korshul's avatar
Oleg.Korshul committed
5268 5269 5270
    
    this.LoadedObject = 1;
    g_oIdCounter.Set_Load(false);
5271
};
Oleg.Korshul's avatar
Oleg.Korshul committed
5272 5273 5274 5275 5276 5277 5278

window["asc_docs_api"].prototype["asc_nativeCalculateFile"] = function()
{
    this.bNoSendComments = false;
    this.ShowParaMarks = false;
    
    var presentation = this.WordControl.m_oLogicDocument;
5279
    presentation.Recalculate({Drawings: {All: true, Map: {}}});
Oleg.Korshul's avatar
Oleg.Korshul committed
5280
    presentation.DrawingDocument.OnEndRecalculate();    
5281
};
Oleg.Korshul's avatar
Oleg.Korshul committed
5282 5283 5284 5285 5286 5287

window["asc_docs_api"].prototype["asc_nativeApplyChanges"] = function(changes)
{
    var _len = changes.length;
	for (var i = 0; i < _len; i++)
	{
5288
	    var Changes = new AscCommon.CCollaborativeChanges();
5289
        Changes.Set_Data( changes[i]);
5290
    AscCommon.CollaborativeEditing.Add_Changes( Changes );
Oleg.Korshul's avatar
Oleg.Korshul committed
5291
	}
5292
  AscCommon.CollaborativeEditing.Apply_OtherChanges();
5293
};
Oleg.Korshul's avatar
Oleg.Korshul committed
5294

5295 5296 5297 5298 5299
window["asc_docs_api"].prototype["asc_nativeApplyChanges2"] = function(data, isFull)
{
    // Чтобы заново созданные параграфы не отображались залоченными
    g_oIdCounter.Set_Load( true );

5300
    var stream = new AscCommon.FT_Stream2(data, data.length);
5301 5302
    stream.obj = null;
    var Loader = { Reader : stream, Reader2 : null };
5303
    var _color = new AscCommonWord.CDocumentColor( 191, 255, 199 );
5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317

    // Применяем изменения, пока они есть
    var _count = Loader.Reader.GetLong();

    var _pos = 4;
    for (var i = 0; i < _count; i++)
    {
        if (window["NATIVE_EDITOR_ENJINE"] === true && window["native"]["CheckNextChange"])
        {
            if (!window["native"]["CheckNextChange"]())
                break;
        }

        var _len = Loader.Reader.GetLong();
5318
        _pos += 4;
5319 5320
        stream.size = _pos + _len;

5321 5322 5323
        var _id  = Loader.Reader.GetString2();
        var _read_pos = Loader.Reader.GetCurPos();

5324 5325 5326
        var Type = Loader.Reader.GetLong();
        var Class = null;

5327
        if ( AscDFH.historyitem_type_HdrFtr === Type )
5328 5329 5330 5331
        {
            Class = editor.WordControl.m_oLogicDocument.HdrFtr;
        }
        else
5332
            Class = g_oTableId.Get_ById( _id );
5333

5334 5335
        stream.Seek(_read_pos);
        stream.Seek2(_read_pos);
5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346

        if ( null != Class )
            Class.Load_Changes( Loader.Reader, Loader.Reader2, _color );

        _pos += _len;
        stream.Seek2(_pos);
        stream.size = data.length;
    }

    if (isFull)
    {
5347
      AscCommon.CollaborativeEditing.m_aChanges = [];
5348 5349

        // У новых элементов выставляем указатели на другие классы
5350
      AscCommon.CollaborativeEditing.Apply_LinkData();
5351 5352

        // Делаем проверки корректности новых изменений
5353
      AscCommon.CollaborativeEditing.Check_MergeData();
5354

5355
      AscCommon.CollaborativeEditing.OnEnd_ReadForeignChanges();
5356 5357 5358
    }

    g_oIdCounter.Set_Load( false );
5359
};
5360

Oleg.Korshul's avatar
Oleg.Korshul committed
5361 5362
window["asc_docs_api"].prototype["asc_nativeGetFile"] = function()
{
5363
	var writer = new AscCommon.CBinaryFileWriter();
Oleg.Korshul's avatar
Oleg.Korshul committed
5364 5365
    this.WordControl.m_oLogicDocument.CalculateComments();
    return writer.WriteDocument(this.WordControl.m_oLogicDocument);
5366
};
Oleg.Korshul's avatar
Oleg.Korshul committed
5367

5368 5369
window["asc_docs_api"].prototype["asc_nativeGetFileData"] = function()
{
5370
    var writer = new AscCommon.CBinaryFileWriter();
5371 5372 5373 5374 5375 5376 5377
    this.WordControl.m_oLogicDocument.CalculateComments();
    writer.WriteDocument2(this.WordControl.m_oLogicDocument);

    var _header = "PPTY;v1;" + writer.pos + ";";
    window["native"]["Save_End"](_header, writer.pos);

    return writer.ImData.data;
5378
};
5379

Oleg.Korshul's avatar
Oleg.Korshul committed
5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404
window["asc_docs_api"].prototype["asc_nativeCheckPdfRenderer"] = function(_memory1, _memory2)
{
	if (true)
	{
		// pos не должен минимизироваться!!!

		_memory1.Copy           = _memory1["Copy"];
		_memory1.ClearNoAttack  = _memory1["ClearNoAttack"];
		_memory1.WriteByte      = _memory1["WriteByte"];
		_memory1.WriteBool      = _memory1["WriteBool"];
		_memory1.WriteLong      = _memory1["WriteLong"];
		_memory1.WriteDouble    = _memory1["WriteDouble"];
		_memory1.WriteString    = _memory1["WriteString"];
		_memory1.WriteString2   = _memory1["WriteString2"];
		
		_memory2.Copy           = _memory1["Copy"];
		_memory2.ClearNoAttack  = _memory1["ClearNoAttack"];
		_memory2.WriteByte      = _memory1["WriteByte"];
		_memory2.WriteBool      = _memory1["WriteBool"];
		_memory2.WriteLong      = _memory1["WriteLong"];
		_memory2.WriteDouble    = _memory1["WriteDouble"];
		_memory2.WriteString    = _memory1["WriteString"];
		_memory2.WriteString2   = _memory1["WriteString2"];
	}
	
5405
	var _printer = new AscCommon.CDocumentRenderer();
Oleg.Korshul's avatar
Oleg.Korshul committed
5406 5407 5408
	_printer.Memory				    = _memory1;
	_printer.VectorMemoryForPrint	= _memory2;
	return _printer;
5409
};
Oleg.Korshul's avatar
Oleg.Korshul committed
5410 5411 5412

window["asc_docs_api"].prototype["asc_nativeCalculate"] = function()
{
5413
};
Oleg.Korshul's avatar
Oleg.Korshul committed
5414 5415 5416

window["asc_docs_api"].prototype["asc_nativePrint"] = function(_printer, _page)
{
5417 5418 5419 5420 5421 5422 5423
    if (undefined === _printer && _page === undefined)
    {
        if (undefined !== window["AscDesktopEditor"])
        {
            var _drawing_document = this.WordControl.m_oDrawingDocument;
            var pagescount = _drawing_document.SlidesCount;

Oleg.Korshul's avatar
Oleg.Korshul committed
5424
            window["AscDesktopEditor"]["Print_Start"](this.DocumentUrl, pagescount, this.ThemeLoader.ThemesUrl, this.getCurrentPage());
5425

5426 5427
            var oDocRenderer = new AscCommon.CDocumentRenderer();
            oDocRenderer.VectorMemoryForPrint = new AscCommon.CMemory();
5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440
            var bOldShowMarks = this.ShowParaMarks;
            this.ShowParaMarks = false;
            oDocRenderer.IsNoDrawingEmptyPlaceholder = true;

            for (var i = 0; i < pagescount; i++)
            {
                oDocRenderer.Memory.Seek(0);
                oDocRenderer.VectorMemoryForPrint.ClearNoAttack();

                oDocRenderer.BeginPage(_drawing_document.m_oLogicDocument.Width, _drawing_document.m_oLogicDocument.Height);
                this.WordControl.m_oLogicDocument.DrawPage(i, oDocRenderer);
                oDocRenderer.EndPage();

5441
                window["AscDesktopEditor"]["Print_Page"](oDocRenderer.Memory.GetBase64Memory(), _drawing_document.m_oLogicDocument.Width, _drawing_document.m_oLogicDocument.Height);
5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458
            }

            if (0 == pagescount)
            {
                oDocRenderer.BeginPage(_drawing_document.m_oLogicDocument.Width, _drawing_document.m_oLogicDocument.Height);
                oDocRenderer.EndPage();

                window["AscDesktopEditor"]["Print_Page"](oDocRenderer.Memory.GetBase64Memory());
            }

            this.ShowParaMarks = bOldShowMarks;

            window["AscDesktopEditor"]["Print_End"]();
        }
        return;
    }

Oleg.Korshul's avatar
Oleg.Korshul committed
5459 5460 5461 5462
	var _logic_doc = this.WordControl.m_oLogicDocument;
    _printer.BeginPage(_logic_doc.Width, _logic_doc.Height);
    _logic_doc.DrawPage(_page, _printer);
    _printer.EndPage();
5463
};
Oleg.Korshul's avatar
Oleg.Korshul committed
5464 5465 5466 5467

window["asc_docs_api"].prototype["asc_nativePrintPagesCount"] = function()
{
	return this.WordControl.m_oDrawingDocument.SlidesCount;
5468
};
5469

5470 5471 5472 5473
window["asc_docs_api"].prototype["asc_nativeGetPDF"] = function()
{
    var pagescount = this["asc_nativePrintPagesCount"]();

5474 5475
    var _renderer = new AscCommon.CDocumentRenderer();
    _renderer.VectorMemoryForPrint = new AscCommon.CMemory();
5476 5477 5478 5479 5480 5481 5482 5483 5484 5485 5486 5487 5488 5489 5490 5491
    var _bOldShowMarks = this.ShowParaMarks;
    this.ShowParaMarks = false;
    _renderer.IsNoDrawingEmptyPlaceholder = true;

    for (var i = 0; i < pagescount; i++)
    {
        this["asc_nativePrint"](_renderer, i);
    }

    this.ShowParaMarks = _bOldShowMarks;

    window["native"]["Save_End"]("", _renderer.Memory.GetCurPosition());

    return _renderer.Memory.data;
};

5492 5493
window["AscDesktopEditor_Save"] = function()
{
5494
    return editor.asc_Save(false);
5495 5496 5497 5498
};

//-------------------------------------------------------------export---------------------------------------------------
window['Asc'] = window['Asc'] || {};
5499
window['AscCommonSlide'] = window['AscCommonSlide'] || {};
5500 5501 5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535
window['Asc']['asc_docs_api'] = asc_docs_api;
asc_docs_api.prototype['asc_GetFontThumbnailsPath'] = asc_docs_api.prototype.asc_GetFontThumbnailsPath;
asc_docs_api.prototype['pre_Save'] = asc_docs_api.prototype.pre_Save;
asc_docs_api.prototype['sync_CollaborativeChanges'] = asc_docs_api.prototype.sync_CollaborativeChanges;
asc_docs_api.prototype['asc_coAuthoringDisconnect'] = asc_docs_api.prototype.asc_coAuthoringDisconnect;
asc_docs_api.prototype['asc_coAuthoringChatSendMessage'] = asc_docs_api.prototype.asc_coAuthoringChatSendMessage;
asc_docs_api.prototype['asc_coAuthoringChatGetMessages'] = asc_docs_api.prototype.asc_coAuthoringChatGetMessages;
asc_docs_api.prototype['asc_coAuthoringGetUsers'] = asc_docs_api.prototype.asc_coAuthoringGetUsers;
asc_docs_api.prototype['syncCollaborativeChanges'] = asc_docs_api.prototype.syncCollaborativeChanges;
asc_docs_api.prototype['SetCollaborativeMarksShowType'] = asc_docs_api.prototype.SetCollaborativeMarksShowType;
asc_docs_api.prototype['GetCollaborativeMarksShowType'] = asc_docs_api.prototype.GetCollaborativeMarksShowType;
asc_docs_api.prototype['Clear_CollaborativeMarks'] = asc_docs_api.prototype.Clear_CollaborativeMarks;
asc_docs_api.prototype['_onUpdateDocumentCanSave'] = asc_docs_api.prototype._onUpdateDocumentCanSave;
asc_docs_api.prototype['SetUnchangedDocument'] = asc_docs_api.prototype.SetUnchangedDocument;
asc_docs_api.prototype['SetDocumentModified'] = asc_docs_api.prototype.SetDocumentModified;
asc_docs_api.prototype['isDocumentModified'] = asc_docs_api.prototype.isDocumentModified;
asc_docs_api.prototype['asc_isDocumentCanSave'] = asc_docs_api.prototype.asc_isDocumentCanSave;
asc_docs_api.prototype['sync_BeginCatchSelectedElements'] = asc_docs_api.prototype.sync_BeginCatchSelectedElements;
asc_docs_api.prototype['sync_EndCatchSelectedElements'] = asc_docs_api.prototype.sync_EndCatchSelectedElements;
asc_docs_api.prototype['getSelectedElements'] = asc_docs_api.prototype.getSelectedElements;
asc_docs_api.prototype['sync_ChangeLastSelectedElement'] = asc_docs_api.prototype.sync_ChangeLastSelectedElement;
asc_docs_api.prototype['asc_getEditorPermissions'] = asc_docs_api.prototype.asc_getEditorPermissions;
asc_docs_api.prototype['asc_setDocInfo'] = asc_docs_api.prototype.asc_setDocInfo;
asc_docs_api.prototype['asc_setLocale'] = asc_docs_api.prototype.asc_setLocale;
asc_docs_api.prototype['asc_LoadDocument'] = asc_docs_api.prototype.asc_LoadDocument;
asc_docs_api.prototype['SetThemesPath'] = asc_docs_api.prototype.SetThemesPath;
asc_docs_api.prototype['InitEditor'] = asc_docs_api.prototype.InitEditor;
asc_docs_api.prototype['SetInterfaceDrawImagePlaceSlide'] = asc_docs_api.prototype.SetInterfaceDrawImagePlaceSlide;
asc_docs_api.prototype['SetInterfaceDrawImagePlaceTextArt'] = asc_docs_api.prototype.SetInterfaceDrawImagePlaceTextArt;
asc_docs_api.prototype['OpenDocument2'] = asc_docs_api.prototype.OpenDocument2;
asc_docs_api.prototype['asc_getDocumentName'] = asc_docs_api.prototype.asc_getDocumentName;
asc_docs_api.prototype['asc_registerCallback'] = asc_docs_api.prototype.asc_registerCallback;
asc_docs_api.prototype['asc_unregisterCallback'] = asc_docs_api.prototype.asc_unregisterCallback;
asc_docs_api.prototype['asc_fireCallback'] = asc_docs_api.prototype.asc_fireCallback;
asc_docs_api.prototype['asc_checkNeedCallback'] = asc_docs_api.prototype.asc_checkNeedCallback;
asc_docs_api.prototype['get_TextProps'] = asc_docs_api.prototype.get_TextProps;
5536
asc_docs_api.prototype['asc_getPropertyEditorShapes'] = asc_docs_api.prototype.asc_getPropertyEditorShapes;
5537
asc_docs_api.prototype['asc_getPropertyEditorTextArts'] = asc_docs_api.prototype.asc_getPropertyEditorTextArts;
5538 5539 5540 5541 5542 5543 5544 5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 5704 5705 5706 5707 5708 5709 5710 5711 5712 5713 5714 5715 5716 5717 5718 5719 5720 5721 5722 5723 5724 5725 5726 5727 5728 5729 5730 5731 5732 5733 5734 5735 5736 5737 5738 5739 5740 5741 5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 5754 5755 5756 5757 5758 5759 5760 5761 5762 5763 5764 5765 5766 5767 5768 5769 5770 5771 5772 5773 5774 5775 5776 5777 5778 5779 5780 5781 5782 5783 5784 5785 5786 5787 5788 5789 5790 5791 5792 5793 5794 5795 5796 5797 5798 5799 5800 5801 5802 5803 5804 5805 5806 5807 5808 5809 5810 5811 5812 5813 5814 5815 5816 5817 5818 5819 5820 5821 5822 5823 5824 5825 5826 5827 5828 5829 5830 5831 5832 5833 5834 5835 5836 5837 5838 5839 5840 5841 5842 5843 5844 5845 5846 5847 5848 5849 5850 5851 5852 5853 5854 5855 5856 5857 5858 5859 5860 5861 5862 5863 5864 5865 5866 5867 5868 5869 5870 5871 5872 5873 5874 5875 5876 5877 5878 5879 5880 5881 5882 5883 5884 5885 5886 5887
asc_docs_api.prototype['get_PropertyEditorThemes'] = asc_docs_api.prototype.get_PropertyEditorThemes;
asc_docs_api.prototype['get_ContentCount'] = asc_docs_api.prototype.get_ContentCount;
asc_docs_api.prototype['select_Element'] = asc_docs_api.prototype.select_Element;
asc_docs_api.prototype['UpdateTextPr'] = asc_docs_api.prototype.UpdateTextPr;
asc_docs_api.prototype['sync_TextSpacing'] = asc_docs_api.prototype.sync_TextSpacing;
asc_docs_api.prototype['sync_TextDStrikeout'] = asc_docs_api.prototype.sync_TextDStrikeout;
asc_docs_api.prototype['sync_TextCaps'] = asc_docs_api.prototype.sync_TextCaps;
asc_docs_api.prototype['sync_TextSmallCaps'] = asc_docs_api.prototype.sync_TextSmallCaps;
asc_docs_api.prototype['sync_TextPosition'] = asc_docs_api.prototype.sync_TextPosition;
asc_docs_api.prototype['sync_TextLangCallBack'] = asc_docs_api.prototype.sync_TextLangCallBack;
asc_docs_api.prototype['sync_VerticalTextAlign'] = asc_docs_api.prototype.sync_VerticalTextAlign;
asc_docs_api.prototype['sync_Vert'] = asc_docs_api.prototype.sync_Vert;
asc_docs_api.prototype['UpdateParagraphProp'] = asc_docs_api.prototype.UpdateParagraphProp;
asc_docs_api.prototype['asc_Print'] = asc_docs_api.prototype.asc_Print;
asc_docs_api.prototype['Undo'] = asc_docs_api.prototype.Undo;
asc_docs_api.prototype['Redo'] = asc_docs_api.prototype.Redo;
asc_docs_api.prototype['Copy'] = asc_docs_api.prototype.Copy;
asc_docs_api.prototype['Update_ParaTab'] = asc_docs_api.prototype.Update_ParaTab;
asc_docs_api.prototype['Cut'] = asc_docs_api.prototype.Cut;
asc_docs_api.prototype['Paste'] = asc_docs_api.prototype.Paste;
asc_docs_api.prototype['Share'] = asc_docs_api.prototype.Share;
asc_docs_api.prototype['asc_Save'] = asc_docs_api.prototype.asc_Save;
asc_docs_api.prototype['asc_DownloadAs'] = asc_docs_api.prototype.asc_DownloadAs;
asc_docs_api.prototype['Resize'] = asc_docs_api.prototype.Resize;
asc_docs_api.prototype['AddURL'] = asc_docs_api.prototype.AddURL;
asc_docs_api.prototype['Help'] = asc_docs_api.prototype.Help;
asc_docs_api.prototype['startGetDocInfo'] = asc_docs_api.prototype.startGetDocInfo;
asc_docs_api.prototype['stopGetDocInfo'] = asc_docs_api.prototype.stopGetDocInfo;
asc_docs_api.prototype['sync_DocInfoCallback'] = asc_docs_api.prototype.sync_DocInfoCallback;
asc_docs_api.prototype['sync_GetDocInfoStartCallback'] = asc_docs_api.prototype.sync_GetDocInfoStartCallback;
asc_docs_api.prototype['sync_GetDocInfoStopCallback'] = asc_docs_api.prototype.sync_GetDocInfoStopCallback;
asc_docs_api.prototype['sync_GetDocInfoEndCallback'] = asc_docs_api.prototype.sync_GetDocInfoEndCallback;
asc_docs_api.prototype['sync_CanUndoCallback'] = asc_docs_api.prototype.sync_CanUndoCallback;
asc_docs_api.prototype['sync_CanRedoCallback'] = asc_docs_api.prototype.sync_CanRedoCallback;
asc_docs_api.prototype['sync_CursorLockCallBack'] = asc_docs_api.prototype.sync_CursorLockCallBack;
asc_docs_api.prototype['sync_UndoCallBack'] = asc_docs_api.prototype.sync_UndoCallBack;
asc_docs_api.prototype['sync_RedoCallBack'] = asc_docs_api.prototype.sync_RedoCallBack;
asc_docs_api.prototype['sync_CopyCallBack'] = asc_docs_api.prototype.sync_CopyCallBack;
asc_docs_api.prototype['sync_CutCallBack'] = asc_docs_api.prototype.sync_CutCallBack;
asc_docs_api.prototype['sync_PasteCallBack'] = asc_docs_api.prototype.sync_PasteCallBack;
asc_docs_api.prototype['sync_ShareCallBack'] = asc_docs_api.prototype.sync_ShareCallBack;
asc_docs_api.prototype['sync_SaveCallBack'] = asc_docs_api.prototype.sync_SaveCallBack;
asc_docs_api.prototype['sync_DownloadAsCallBack'] = asc_docs_api.prototype.sync_DownloadAsCallBack;
asc_docs_api.prototype['sync_StartAction'] = asc_docs_api.prototype.sync_StartAction;
asc_docs_api.prototype['sync_EndAction'] = asc_docs_api.prototype.sync_EndAction;
asc_docs_api.prototype['sync_AddURLCallback'] = asc_docs_api.prototype.sync_AddURLCallback;
asc_docs_api.prototype['sync_ErrorCallback'] = asc_docs_api.prototype.sync_ErrorCallback;
asc_docs_api.prototype['sync_HelpCallback'] = asc_docs_api.prototype.sync_HelpCallback;
asc_docs_api.prototype['sync_UpdateZoom'] = asc_docs_api.prototype.sync_UpdateZoom;
asc_docs_api.prototype['ClearPropObjCallback'] = asc_docs_api.prototype.ClearPropObjCallback;
asc_docs_api.prototype['CollectHeaders'] = asc_docs_api.prototype.CollectHeaders;
asc_docs_api.prototype['GetActiveHeader'] = asc_docs_api.prototype.GetActiveHeader;
asc_docs_api.prototype['gotoHeader'] = asc_docs_api.prototype.gotoHeader;
asc_docs_api.prototype['sync_ChangeActiveHeaderCallback'] = asc_docs_api.prototype.sync_ChangeActiveHeaderCallback;
asc_docs_api.prototype['sync_ReturnHeadersCallback'] = asc_docs_api.prototype.sync_ReturnHeadersCallback;
asc_docs_api.prototype['startSearchText'] = asc_docs_api.prototype.startSearchText;
asc_docs_api.prototype['goToNextSearchResult'] = asc_docs_api.prototype.goToNextSearchResult;
asc_docs_api.prototype['gotoSearchResultText'] = asc_docs_api.prototype.gotoSearchResultText;
asc_docs_api.prototype['stopSearchText'] = asc_docs_api.prototype.stopSearchText;
asc_docs_api.prototype['findText'] = asc_docs_api.prototype.findText;
asc_docs_api.prototype['asc_searchEnabled'] = asc_docs_api.prototype.asc_searchEnabled;
asc_docs_api.prototype['asc_findText'] = asc_docs_api.prototype.asc_findText;
asc_docs_api.prototype['sync_SearchFoundCallback'] = asc_docs_api.prototype.sync_SearchFoundCallback;
asc_docs_api.prototype['sync_SearchStartCallback'] = asc_docs_api.prototype.sync_SearchStartCallback;
asc_docs_api.prototype['sync_SearchStopCallback'] = asc_docs_api.prototype.sync_SearchStopCallback;
asc_docs_api.prototype['sync_SearchEndCallback'] = asc_docs_api.prototype.sync_SearchEndCallback;
asc_docs_api.prototype['put_TextPrFontName'] = asc_docs_api.prototype.put_TextPrFontName;
asc_docs_api.prototype['put_TextPrFontSize'] = asc_docs_api.prototype.put_TextPrFontSize;
asc_docs_api.prototype['put_TextPrBold'] = asc_docs_api.prototype.put_TextPrBold;
asc_docs_api.prototype['put_TextPrItalic'] = asc_docs_api.prototype.put_TextPrItalic;
asc_docs_api.prototype['put_TextPrUnderline'] = asc_docs_api.prototype.put_TextPrUnderline;
asc_docs_api.prototype['put_TextPrStrikeout'] = asc_docs_api.prototype.put_TextPrStrikeout;
asc_docs_api.prototype['put_PrLineSpacing'] = asc_docs_api.prototype.put_PrLineSpacing;
asc_docs_api.prototype['put_LineSpacingBeforeAfter'] = asc_docs_api.prototype.put_LineSpacingBeforeAfter;
asc_docs_api.prototype['FontSizeIn'] = asc_docs_api.prototype.FontSizeIn;
asc_docs_api.prototype['FontSizeOut'] = asc_docs_api.prototype.FontSizeOut;
asc_docs_api.prototype['put_AlignBySelect'] = asc_docs_api.prototype.put_AlignBySelect;
asc_docs_api.prototype['get_AlignBySelect'] = asc_docs_api.prototype.get_AlignBySelect;
asc_docs_api.prototype['sync_BoldCallBack'] = asc_docs_api.prototype.sync_BoldCallBack;
asc_docs_api.prototype['sync_ItalicCallBack'] = asc_docs_api.prototype.sync_ItalicCallBack;
asc_docs_api.prototype['sync_UnderlineCallBack'] = asc_docs_api.prototype.sync_UnderlineCallBack;
asc_docs_api.prototype['sync_StrikeoutCallBack'] = asc_docs_api.prototype.sync_StrikeoutCallBack;
asc_docs_api.prototype['sync_TextPrFontFamilyCallBack'] = asc_docs_api.prototype.sync_TextPrFontFamilyCallBack;
asc_docs_api.prototype['sync_TextPrFontSizeCallBack'] = asc_docs_api.prototype.sync_TextPrFontSizeCallBack;
asc_docs_api.prototype['sync_PrLineSpacingCallBack'] = asc_docs_api.prototype.sync_PrLineSpacingCallBack;
asc_docs_api.prototype['sync_InitEditorThemes'] = asc_docs_api.prototype.sync_InitEditorThemes;
asc_docs_api.prototype['sync_InitEditorTableStyles'] = asc_docs_api.prototype.sync_InitEditorTableStyles;
asc_docs_api.prototype['paraApply'] = asc_docs_api.prototype.paraApply;
asc_docs_api.prototype['put_PrAlign'] = asc_docs_api.prototype.put_PrAlign;
asc_docs_api.prototype['put_TextPrBaseline'] = asc_docs_api.prototype.put_TextPrBaseline;
asc_docs_api.prototype['put_ListType'] = asc_docs_api.prototype.put_ListType;
asc_docs_api.prototype['put_ShowSnapLines'] = asc_docs_api.prototype.put_ShowSnapLines;
asc_docs_api.prototype['get_ShowSnapLines'] = asc_docs_api.prototype.get_ShowSnapLines;
asc_docs_api.prototype['put_ShowParaMarks'] = asc_docs_api.prototype.put_ShowParaMarks;
asc_docs_api.prototype['get_ShowParaMarks'] = asc_docs_api.prototype.get_ShowParaMarks;
asc_docs_api.prototype['put_ShowTableEmptyLine'] = asc_docs_api.prototype.put_ShowTableEmptyLine;
asc_docs_api.prototype['get_ShowTableEmptyLine'] = asc_docs_api.prototype.get_ShowTableEmptyLine;
asc_docs_api.prototype['ShapeApply'] = asc_docs_api.prototype.ShapeApply;
asc_docs_api.prototype['setStartPointHistory'] = asc_docs_api.prototype.setStartPointHistory;
asc_docs_api.prototype['setEndPointHistory'] = asc_docs_api.prototype.setEndPointHistory;
asc_docs_api.prototype['SetSlideProps'] = asc_docs_api.prototype.SetSlideProps;
asc_docs_api.prototype['put_LineCap'] = asc_docs_api.prototype.put_LineCap;
asc_docs_api.prototype['put_LineJoin'] = asc_docs_api.prototype.put_LineJoin;
asc_docs_api.prototype['put_LineBeginStyle'] = asc_docs_api.prototype.put_LineBeginStyle;
asc_docs_api.prototype['put_LineBeginSize'] = asc_docs_api.prototype.put_LineBeginSize;
asc_docs_api.prototype['put_LineEndStyle'] = asc_docs_api.prototype.put_LineEndStyle;
asc_docs_api.prototype['put_LineEndSize'] = asc_docs_api.prototype.put_LineEndSize;
asc_docs_api.prototype['put_TextColor2'] = asc_docs_api.prototype.put_TextColor2;
asc_docs_api.prototype['put_TextColor'] = asc_docs_api.prototype.put_TextColor;
asc_docs_api.prototype['put_PrIndent'] = asc_docs_api.prototype.put_PrIndent;
asc_docs_api.prototype['IncreaseIndent'] = asc_docs_api.prototype.IncreaseIndent;
asc_docs_api.prototype['DecreaseIndent'] = asc_docs_api.prototype.DecreaseIndent;
asc_docs_api.prototype['put_PrIndentRight'] = asc_docs_api.prototype.put_PrIndentRight;
asc_docs_api.prototype['put_PrFirstLineIndent'] = asc_docs_api.prototype.put_PrFirstLineIndent;
asc_docs_api.prototype['getFocusObject'] = asc_docs_api.prototype.getFocusObject;
asc_docs_api.prototype['sync_VerticalAlign'] = asc_docs_api.prototype.sync_VerticalAlign;
asc_docs_api.prototype['sync_PrAlignCallBack'] = asc_docs_api.prototype.sync_PrAlignCallBack;
asc_docs_api.prototype['sync_ListType'] = asc_docs_api.prototype.sync_ListType;
asc_docs_api.prototype['sync_TextColor'] = asc_docs_api.prototype.sync_TextColor;
asc_docs_api.prototype['sync_TextColor2'] = asc_docs_api.prototype.sync_TextColor2;
asc_docs_api.prototype['sync_TextHighLight'] = asc_docs_api.prototype.sync_TextHighLight;
asc_docs_api.prototype['sync_ParaStyleName'] = asc_docs_api.prototype.sync_ParaStyleName;
asc_docs_api.prototype['sync_ParaSpacingLine'] = asc_docs_api.prototype.sync_ParaSpacingLine;
asc_docs_api.prototype['sync_PageBreakCallback'] = asc_docs_api.prototype.sync_PageBreakCallback;
asc_docs_api.prototype['sync_KeepLinesCallback'] = asc_docs_api.prototype.sync_KeepLinesCallback;
asc_docs_api.prototype['sync_ShowParaMarksCallback'] = asc_docs_api.prototype.sync_ShowParaMarksCallback;
asc_docs_api.prototype['sync_SpaceBetweenPrgCallback'] = asc_docs_api.prototype.sync_SpaceBetweenPrgCallback;
asc_docs_api.prototype['sync_PrPropCallback'] = asc_docs_api.prototype.sync_PrPropCallback;
asc_docs_api.prototype['SetDrawImagePlaceParagraph'] = asc_docs_api.prototype.SetDrawImagePlaceParagraph;
asc_docs_api.prototype['get_DocumentOrientation'] = asc_docs_api.prototype.get_DocumentOrientation;
asc_docs_api.prototype['put_AddPageBreak'] = asc_docs_api.prototype.put_AddPageBreak;
asc_docs_api.prototype['Update_ParaInd'] = asc_docs_api.prototype.Update_ParaInd;
asc_docs_api.prototype['Internal_Update_Ind_FirstLine'] = asc_docs_api.prototype.Internal_Update_Ind_FirstLine;
asc_docs_api.prototype['Internal_Update_Ind_Left'] = asc_docs_api.prototype.Internal_Update_Ind_Left;
asc_docs_api.prototype['Internal_Update_Ind_Right'] = asc_docs_api.prototype.Internal_Update_Ind_Right;
asc_docs_api.prototype['sync_DocSizeCallback'] = asc_docs_api.prototype.sync_DocSizeCallback;
asc_docs_api.prototype['sync_PageOrientCallback'] = asc_docs_api.prototype.sync_PageOrientCallback;
asc_docs_api.prototype['sync_HeadersAndFootersPropCallback'] = asc_docs_api.prototype.sync_HeadersAndFootersPropCallback;
asc_docs_api.prototype['put_Table'] = asc_docs_api.prototype.put_Table;
asc_docs_api.prototype['addRowAbove'] = asc_docs_api.prototype.addRowAbove;
asc_docs_api.prototype['addRowBelow'] = asc_docs_api.prototype.addRowBelow;
asc_docs_api.prototype['addColumnLeft'] = asc_docs_api.prototype.addColumnLeft;
asc_docs_api.prototype['addColumnRight'] = asc_docs_api.prototype.addColumnRight;
asc_docs_api.prototype['remRow'] = asc_docs_api.prototype.remRow;
asc_docs_api.prototype['remColumn'] = asc_docs_api.prototype.remColumn;
asc_docs_api.prototype['remTable'] = asc_docs_api.prototype.remTable;
asc_docs_api.prototype['selectRow'] = asc_docs_api.prototype.selectRow;
asc_docs_api.prototype['selectColumn'] = asc_docs_api.prototype.selectColumn;
asc_docs_api.prototype['selectCell'] = asc_docs_api.prototype.selectCell;
asc_docs_api.prototype['selectTable'] = asc_docs_api.prototype.selectTable;
asc_docs_api.prototype['setColumnWidth'] = asc_docs_api.prototype.setColumnWidth;
asc_docs_api.prototype['setRowHeight'] = asc_docs_api.prototype.setRowHeight;
asc_docs_api.prototype['set_TblDistanceFromText'] = asc_docs_api.prototype.set_TblDistanceFromText;
asc_docs_api.prototype['CheckBeforeMergeCells'] = asc_docs_api.prototype.CheckBeforeMergeCells;
asc_docs_api.prototype['CheckBeforeSplitCells'] = asc_docs_api.prototype.CheckBeforeSplitCells;
asc_docs_api.prototype['MergeCells'] = asc_docs_api.prototype.MergeCells;
asc_docs_api.prototype['SplitCell'] = asc_docs_api.prototype.SplitCell;
asc_docs_api.prototype['widthTable'] = asc_docs_api.prototype.widthTable;
asc_docs_api.prototype['put_CellsMargin'] = asc_docs_api.prototype.put_CellsMargin;
asc_docs_api.prototype['set_TblWrap'] = asc_docs_api.prototype.set_TblWrap;
asc_docs_api.prototype['set_TblIndentLeft'] = asc_docs_api.prototype.set_TblIndentLeft;
asc_docs_api.prototype['set_Borders'] = asc_docs_api.prototype.set_Borders;
asc_docs_api.prototype['set_TableBackground'] = asc_docs_api.prototype.set_TableBackground;
asc_docs_api.prototype['set_AlignCell'] = asc_docs_api.prototype.set_AlignCell;
asc_docs_api.prototype['set_TblAlign'] = asc_docs_api.prototype.set_TblAlign;
asc_docs_api.prototype['set_SpacingBetweenCells'] = asc_docs_api.prototype.set_SpacingBetweenCells;
asc_docs_api.prototype['tblApply'] = asc_docs_api.prototype.tblApply;
asc_docs_api.prototype['sync_AddTableCallback'] = asc_docs_api.prototype.sync_AddTableCallback;
asc_docs_api.prototype['sync_AlignCellCallback'] = asc_docs_api.prototype.sync_AlignCellCallback;
asc_docs_api.prototype['sync_TblPropCallback'] = asc_docs_api.prototype.sync_TblPropCallback;
asc_docs_api.prototype['sync_TblWrapStyleChangedCallback'] = asc_docs_api.prototype.sync_TblWrapStyleChangedCallback;
asc_docs_api.prototype['sync_TblAlignChangedCallback'] = asc_docs_api.prototype.sync_TblAlignChangedCallback;
asc_docs_api.prototype['ChangeImageFromFile'] = asc_docs_api.prototype.ChangeImageFromFile;
asc_docs_api.prototype['ChangeShapeImageFromFile'] = asc_docs_api.prototype.ChangeShapeImageFromFile;
asc_docs_api.prototype['ChangeSlideImageFromFile'] = asc_docs_api.prototype.ChangeSlideImageFromFile;
asc_docs_api.prototype['ChangeArtImageFromFile'] = asc_docs_api.prototype.ChangeArtImageFromFile;
asc_docs_api.prototype['AddImage'] = asc_docs_api.prototype.AddImage;
asc_docs_api.prototype['asc_addImage'] = asc_docs_api.prototype.asc_addImage;
asc_docs_api.prototype['StartAddShape'] = asc_docs_api.prototype.StartAddShape;
asc_docs_api.prototype['AddTextArt'] = asc_docs_api.prototype.AddTextArt;
asc_docs_api.prototype['canGroup'] = asc_docs_api.prototype.canGroup;
asc_docs_api.prototype['canUnGroup'] = asc_docs_api.prototype.canUnGroup;
asc_docs_api.prototype['AddImageUrl'] = asc_docs_api.prototype.AddImageUrl;
asc_docs_api.prototype['AddImageUrlActionCallback'] = asc_docs_api.prototype.AddImageUrlActionCallback;
asc_docs_api.prototype['AddImageUrlAction'] = asc_docs_api.prototype.AddImageUrlAction;
asc_docs_api.prototype['ImgApply'] = asc_docs_api.prototype.ImgApply;
asc_docs_api.prototype['asc_setChartTranslate'] = asc_docs_api.prototype.asc_setChartTranslate;
asc_docs_api.prototype['asc_setTextArtTranslate'] = asc_docs_api.prototype.asc_setTextArtTranslate;
asc_docs_api.prototype['ChartApply'] = asc_docs_api.prototype.ChartApply;
asc_docs_api.prototype['set_Size'] = asc_docs_api.prototype.set_Size;
asc_docs_api.prototype['set_ConstProportions'] = asc_docs_api.prototype.set_ConstProportions;
asc_docs_api.prototype['set_WrapStyle'] = asc_docs_api.prototype.set_WrapStyle;
asc_docs_api.prototype['deleteImage'] = asc_docs_api.prototype.deleteImage;
asc_docs_api.prototype['set_ImgDistanceFromText'] = asc_docs_api.prototype.set_ImgDistanceFromText;
asc_docs_api.prototype['set_PositionOnPage'] = asc_docs_api.prototype.set_PositionOnPage;
asc_docs_api.prototype['get_OriginalSizeImage'] = asc_docs_api.prototype.get_OriginalSizeImage;
asc_docs_api.prototype['asc_onCloseChartFrame'] = asc_docs_api.prototype.asc_onCloseChartFrame;
asc_docs_api.prototype['sync_AddImageCallback'] = asc_docs_api.prototype.sync_AddImageCallback;
asc_docs_api.prototype['sync_ImgPropCallback'] = asc_docs_api.prototype.sync_ImgPropCallback;
asc_docs_api.prototype['SetDrawingFreeze'] = asc_docs_api.prototype.SetDrawingFreeze;
asc_docs_api.prototype['zoomIn'] = asc_docs_api.prototype.zoomIn;
asc_docs_api.prototype['zoomOut'] = asc_docs_api.prototype.zoomOut;
asc_docs_api.prototype['zoomFitToPage'] = asc_docs_api.prototype.zoomFitToPage;
asc_docs_api.prototype['zoomFitToWidth'] = asc_docs_api.prototype.zoomFitToWidth;
asc_docs_api.prototype['zoomCustomMode'] = asc_docs_api.prototype.zoomCustomMode;
asc_docs_api.prototype['zoom100'] = asc_docs_api.prototype.zoom100;
asc_docs_api.prototype['zoom'] = asc_docs_api.prototype.zoom;
asc_docs_api.prototype['goToPage'] = asc_docs_api.prototype.goToPage;
asc_docs_api.prototype['getCountPages'] = asc_docs_api.prototype.getCountPages;
asc_docs_api.prototype['getCurrentPage'] = asc_docs_api.prototype.getCurrentPage;
asc_docs_api.prototype['sync_countPagesCallback'] = asc_docs_api.prototype.sync_countPagesCallback;
asc_docs_api.prototype['sync_currentPageCallback'] = asc_docs_api.prototype.sync_currentPageCallback;
asc_docs_api.prototype['sync_SendThemeColors'] = asc_docs_api.prototype.sync_SendThemeColors;
asc_docs_api.prototype['sync_SendThemeColorSchemes'] = asc_docs_api.prototype.sync_SendThemeColorSchemes;
asc_docs_api.prototype['ChangeColorScheme'] = asc_docs_api.prototype.ChangeColorScheme;
asc_docs_api.prototype['asc_enableKeyEvents'] = asc_docs_api.prototype.asc_enableKeyEvents;
asc_docs_api.prototype['asc_showComments'] = asc_docs_api.prototype.asc_showComments;
asc_docs_api.prototype['asc_hideComments'] = asc_docs_api.prototype.asc_hideComments;
asc_docs_api.prototype['asc_addComment'] = asc_docs_api.prototype.asc_addComment;
asc_docs_api.prototype['asc_getMasterCommentId'] = asc_docs_api.prototype.asc_getMasterCommentId;
asc_docs_api.prototype['asc_getAnchorPosition'] = asc_docs_api.prototype.asc_getAnchorPosition;
asc_docs_api.prototype['asc_removeComment'] = asc_docs_api.prototype.asc_removeComment;
asc_docs_api.prototype['asc_changeComment'] = asc_docs_api.prototype.asc_changeComment;
asc_docs_api.prototype['asc_selectComment'] = asc_docs_api.prototype.asc_selectComment;
asc_docs_api.prototype['asc_showComment'] = asc_docs_api.prototype.asc_showComment;
asc_docs_api.prototype['can_AddQuotedComment'] = asc_docs_api.prototype.can_AddQuotedComment;
asc_docs_api.prototype['sync_RemoveComment'] = asc_docs_api.prototype.sync_RemoveComment;
asc_docs_api.prototype['sync_AddComment'] = asc_docs_api.prototype.sync_AddComment;
asc_docs_api.prototype['sync_ShowComment'] = asc_docs_api.prototype.sync_ShowComment;
asc_docs_api.prototype['sync_HideComment'] = asc_docs_api.prototype.sync_HideComment;
asc_docs_api.prototype['sync_UpdateCommentPosition'] = asc_docs_api.prototype.sync_UpdateCommentPosition;
asc_docs_api.prototype['sync_ChangeCommentData'] = asc_docs_api.prototype.sync_ChangeCommentData;
asc_docs_api.prototype['sync_LockComment'] = asc_docs_api.prototype.sync_LockComment;
asc_docs_api.prototype['sync_UnLockComment'] = asc_docs_api.prototype.sync_UnLockComment;
asc_docs_api.prototype['GenerateStyles'] = asc_docs_api.prototype.GenerateStyles;
asc_docs_api.prototype['asyncFontsDocumentEndLoaded'] = asc_docs_api.prototype.asyncFontsDocumentEndLoaded;
asc_docs_api.prototype['asyncImagesDocumentEndLoaded'] = asc_docs_api.prototype.asyncImagesDocumentEndLoaded;
asc_docs_api.prototype['asc_getComments'] = asc_docs_api.prototype.asc_getComments;
asc_docs_api.prototype['OpenDocumentEndCallback'] = asc_docs_api.prototype.OpenDocumentEndCallback;
asc_docs_api.prototype['asyncFontEndLoaded'] = asc_docs_api.prototype.asyncFontEndLoaded;
asc_docs_api.prototype['asyncImageEndLoaded'] = asc_docs_api.prototype.asyncImageEndLoaded;
asc_docs_api.prototype['get_PresentationWidth'] = asc_docs_api.prototype.get_PresentationWidth;
asc_docs_api.prototype['get_PresentationHeight'] = asc_docs_api.prototype.get_PresentationHeight;
asc_docs_api.prototype['pre_Paste'] = asc_docs_api.prototype.pre_Paste;
asc_docs_api.prototype['pre_SaveCallback'] = asc_docs_api.prototype.pre_SaveCallback;
asc_docs_api.prototype['initEvents2MobileAdvances'] = asc_docs_api.prototype.initEvents2MobileAdvances;
asc_docs_api.prototype['ViewScrollToX'] = asc_docs_api.prototype.ViewScrollToX;
asc_docs_api.prototype['ViewScrollToY'] = asc_docs_api.prototype.ViewScrollToY;
asc_docs_api.prototype['GetDocWidthPx'] = asc_docs_api.prototype.GetDocWidthPx;
asc_docs_api.prototype['GetDocHeightPx'] = asc_docs_api.prototype.GetDocHeightPx;
asc_docs_api.prototype['ClearSearch'] = asc_docs_api.prototype.ClearSearch;
asc_docs_api.prototype['GetCurrentVisiblePage'] = asc_docs_api.prototype.GetCurrentVisiblePage;
asc_docs_api.prototype['asc_setAutoSaveGap'] = asc_docs_api.prototype.asc_setAutoSaveGap;
asc_docs_api.prototype['asc_SetDocumentPlaceChangedEnabled'] = asc_docs_api.prototype.asc_SetDocumentPlaceChangedEnabled;
asc_docs_api.prototype['asc_SetViewRulers'] = asc_docs_api.prototype.asc_SetViewRulers;
asc_docs_api.prototype['asc_SetViewRulersChange'] = asc_docs_api.prototype.asc_SetViewRulersChange;
asc_docs_api.prototype['asc_GetViewRulers'] = asc_docs_api.prototype.asc_GetViewRulers;
asc_docs_api.prototype['asc_SetDocumentUnits'] = asc_docs_api.prototype.asc_SetDocumentUnits;
asc_docs_api.prototype['SetMobileVersion'] = asc_docs_api.prototype.SetMobileVersion;
asc_docs_api.prototype['GoToHeader'] = asc_docs_api.prototype.GoToHeader;
asc_docs_api.prototype['changeSlideSize'] = asc_docs_api.prototype.changeSlideSize;
asc_docs_api.prototype['AddSlide'] = asc_docs_api.prototype.AddSlide;
asc_docs_api.prototype['DeleteSlide'] = asc_docs_api.prototype.DeleteSlide;
asc_docs_api.prototype['DublicateSlide'] = asc_docs_api.prototype.DublicateSlide;
asc_docs_api.prototype['SelectAllSlides'] = asc_docs_api.prototype.SelectAllSlides;
asc_docs_api.prototype['AddShape'] = asc_docs_api.prototype.AddShape;
asc_docs_api.prototype['ChangeShapeType'] = asc_docs_api.prototype.ChangeShapeType;
asc_docs_api.prototype['AddText'] = asc_docs_api.prototype.AddText;
asc_docs_api.prototype['groupShapes'] = asc_docs_api.prototype.groupShapes;
asc_docs_api.prototype['unGroupShapes'] = asc_docs_api.prototype.unGroupShapes;
asc_docs_api.prototype['setVerticalAlign'] = asc_docs_api.prototype.setVerticalAlign;
asc_docs_api.prototype['setVert'] = asc_docs_api.prototype.setVert;
asc_docs_api.prototype['sync_MouseMoveStartCallback'] = asc_docs_api.prototype.sync_MouseMoveStartCallback;
asc_docs_api.prototype['sync_MouseMoveEndCallback'] = asc_docs_api.prototype.sync_MouseMoveEndCallback;
asc_docs_api.prototype['sync_MouseMoveCallback'] = asc_docs_api.prototype.sync_MouseMoveCallback;
asc_docs_api.prototype['ShowThumbnails'] = asc_docs_api.prototype.ShowThumbnails;
asc_docs_api.prototype['asc_DeleteVerticalScroll'] = asc_docs_api.prototype.asc_DeleteVerticalScroll;
asc_docs_api.prototype['syncOnThumbnailsShow'] = asc_docs_api.prototype.syncOnThumbnailsShow;
asc_docs_api.prototype['can_AddHyperlink'] = asc_docs_api.prototype.can_AddHyperlink;
asc_docs_api.prototype['add_Hyperlink'] = asc_docs_api.prototype.add_Hyperlink;
asc_docs_api.prototype['change_Hyperlink'] = asc_docs_api.prototype.change_Hyperlink;
asc_docs_api.prototype['remove_Hyperlink'] = asc_docs_api.prototype.remove_Hyperlink;
asc_docs_api.prototype['sync_HyperlinkPropCallback'] = asc_docs_api.prototype.sync_HyperlinkPropCallback;
asc_docs_api.prototype['sync_HyperlinkClickCallback'] = asc_docs_api.prototype.sync_HyperlinkClickCallback;
asc_docs_api.prototype['sync_CanAddHyperlinkCallback'] = asc_docs_api.prototype.sync_CanAddHyperlinkCallback;
asc_docs_api.prototype['sync_DialogAddHyperlink'] = asc_docs_api.prototype.sync_DialogAddHyperlink;
asc_docs_api.prototype['GoToFooter'] = asc_docs_api.prototype.GoToFooter;
asc_docs_api.prototype['sync_shapePropCallback'] = asc_docs_api.prototype.sync_shapePropCallback;
asc_docs_api.prototype['sync_slidePropCallback'] = asc_docs_api.prototype.sync_slidePropCallback;
asc_docs_api.prototype['ExitHeader_Footer'] = asc_docs_api.prototype.ExitHeader_Footer;
asc_docs_api.prototype['GetCurrentPixOffsetY'] = asc_docs_api.prototype.GetCurrentPixOffsetY;
asc_docs_api.prototype['SetPaintFormat'] = asc_docs_api.prototype.SetPaintFormat;
asc_docs_api.prototype['sync_PaintFormatCallback'] = asc_docs_api.prototype.sync_PaintFormatCallback;
asc_docs_api.prototype['ClearFormating'] = asc_docs_api.prototype.ClearFormating;
asc_docs_api.prototype['SetDeviceInputHelperId'] = asc_docs_api.prototype.SetDeviceInputHelperId;
asc_docs_api.prototype['asc_setViewMode'] = asc_docs_api.prototype.asc_setViewMode;
asc_docs_api.prototype['SetUseEmbeddedCutFonts'] = asc_docs_api.prototype.SetUseEmbeddedCutFonts;
asc_docs_api.prototype['can_AddHyperlink'] = asc_docs_api.prototype.can_AddHyperlink;
asc_docs_api.prototype['add_Hyperlink'] = asc_docs_api.prototype.add_Hyperlink;
asc_docs_api.prototype['sync_HyperlinkClickCallback'] = asc_docs_api.prototype.sync_HyperlinkClickCallback;
asc_docs_api.prototype['UpdateInterfaceState'] = asc_docs_api.prototype.UpdateInterfaceState;
asc_docs_api.prototype['OnMouseUp'] = asc_docs_api.prototype.OnMouseUp;
asc_docs_api.prototype['asyncImageEndLoaded2'] = asc_docs_api.prototype.asyncImageEndLoaded2;
asc_docs_api.prototype['ChangeTheme'] = asc_docs_api.prototype.ChangeTheme;
asc_docs_api.prototype['StartLoadTheme'] = asc_docs_api.prototype.StartLoadTheme;
asc_docs_api.prototype['EndLoadTheme'] = asc_docs_api.prototype.EndLoadTheme;
asc_docs_api.prototype['ChangeLayout'] = asc_docs_api.prototype.ChangeLayout;
asc_docs_api.prototype['put_ShapesAlign'] = asc_docs_api.prototype.put_ShapesAlign;
asc_docs_api.prototype['DistributeHorizontally'] = asc_docs_api.prototype.DistributeHorizontally;
asc_docs_api.prototype['DistributeVertically'] = asc_docs_api.prototype.DistributeVertically;
asc_docs_api.prototype['shapes_alignLeft'] = asc_docs_api.prototype.shapes_alignLeft;
asc_docs_api.prototype['shapes_alignRight'] = asc_docs_api.prototype.shapes_alignRight;
asc_docs_api.prototype['shapes_alignTop'] = asc_docs_api.prototype.shapes_alignTop;
asc_docs_api.prototype['shapes_alignBottom'] = asc_docs_api.prototype.shapes_alignBottom;
asc_docs_api.prototype['shapes_alignCenter'] = asc_docs_api.prototype.shapes_alignCenter;
asc_docs_api.prototype['shapes_alignMiddle'] = asc_docs_api.prototype.shapes_alignMiddle;
asc_docs_api.prototype['shapes_bringToFront'] = asc_docs_api.prototype.shapes_bringToFront;
asc_docs_api.prototype['shapes_bringForward'] = asc_docs_api.prototype.shapes_bringForward;
asc_docs_api.prototype['shapes_bringToBack'] = asc_docs_api.prototype.shapes_bringToBack;
asc_docs_api.prototype['shapes_bringBackward'] = asc_docs_api.prototype.shapes_bringBackward;
asc_docs_api.prototype['sync_endDemonstration'] = asc_docs_api.prototype.sync_endDemonstration;
asc_docs_api.prototype['sync_DemonstrationSlideChanged'] = asc_docs_api.prototype.sync_DemonstrationSlideChanged;
asc_docs_api.prototype['StartDemonstration'] = asc_docs_api.prototype.StartDemonstration;
asc_docs_api.prototype['EndDemonstration'] = asc_docs_api.prototype.EndDemonstration;
asc_docs_api.prototype['DemonstrationPlay'] = asc_docs_api.prototype.DemonstrationPlay;
asc_docs_api.prototype['DemonstrationPause'] = asc_docs_api.prototype.DemonstrationPause;
asc_docs_api.prototype['DemonstrationEndShowMessage'] = asc_docs_api.prototype.DemonstrationEndShowMessage;
asc_docs_api.prototype['DemonstrationNextSlide'] = asc_docs_api.prototype.DemonstrationNextSlide;
asc_docs_api.prototype['DemonstrationPrevSlide'] = asc_docs_api.prototype.DemonstrationPrevSlide;
asc_docs_api.prototype['DemonstrationGoToSlide'] = asc_docs_api.prototype.DemonstrationGoToSlide;
asc_docs_api.prototype['ApplySlideTiming'] = asc_docs_api.prototype.ApplySlideTiming;
asc_docs_api.prototype['SlideTimingApplyToAll'] = asc_docs_api.prototype.SlideTimingApplyToAll;
asc_docs_api.prototype['SlideTransitionPlay'] = asc_docs_api.prototype.SlideTransitionPlay;
asc_docs_api.prototype['SetTextBoxInputMode'] = asc_docs_api.prototype.SetTextBoxInputMode;
asc_docs_api.prototype['GetTextBoxInputMode'] = asc_docs_api.prototype.GetTextBoxInputMode;
asc_docs_api.prototype['sync_EndAddShape'] = asc_docs_api.prototype.sync_EndAddShape;
asc_docs_api.prototype['asc_getChartObject'] = asc_docs_api.prototype.asc_getChartObject;
asc_docs_api.prototype['asc_addChartDrawingObject'] = asc_docs_api.prototype.asc_addChartDrawingObject;
asc_docs_api.prototype['asc_editChartDrawingObject'] = asc_docs_api.prototype.asc_editChartDrawingObject;
asc_docs_api.prototype['asc_getChartPreviews'] = asc_docs_api.prototype.asc_getChartPreviews;
asc_docs_api.prototype['asc_getTextArtPreviews'] = asc_docs_api.prototype.asc_getTextArtPreviews;
asc_docs_api.prototype['sync_closeChartEditor'] = asc_docs_api.prototype.sync_closeChartEditor;
asc_docs_api.prototype['asc_stopSaving'] = asc_docs_api.prototype.asc_stopSaving;
asc_docs_api.prototype['asc_continueSaving'] = asc_docs_api.prototype.asc_continueSaving;
asc_docs_api.prototype['asc_undoAllChanges'] = asc_docs_api.prototype.asc_undoAllChanges;
asc_docs_api.prototype['sync_ContextMenuCallback'] = asc_docs_api.prototype.sync_ContextMenuCallback;
asc_docs_api.prototype['asc_addComment'] = asc_docs_api.prototype.asc_addComment;
asc_docs_api.prototype['asc_SetFastCollaborative'] = asc_docs_api.prototype.asc_SetFastCollaborative;
asc_docs_api.prototype['asc_isOffline'] = asc_docs_api.prototype.asc_isOffline;
asc_docs_api.prototype['asc_getUrlType'] = asc_docs_api.prototype.asc_getUrlType;
5888 5889
asc_docs_api.prototype["asc_setInterfaceDrawImagePlaceShape"] = asc_docs_api.prototype.asc_setInterfaceDrawImagePlaceShape;

Alexander.Trofimov's avatar
Alexander.Trofimov committed
5890
window['Asc']['asc_CCommentData'] = window['Asc'].asc_CCommentData = asc_CCommentData;
5891 5892 5893 5894 5895 5896 5897 5898 5899 5900 5901 5902 5903 5904 5905
asc_CCommentData.prototype['asc_getText'] = asc_CCommentData.prototype.asc_getText;
asc_CCommentData.prototype['asc_putText'] = asc_CCommentData.prototype.asc_putText;
asc_CCommentData.prototype['asc_getTime'] = asc_CCommentData.prototype.asc_getTime;
asc_CCommentData.prototype['asc_putTime'] = asc_CCommentData.prototype.asc_putTime;
asc_CCommentData.prototype['asc_getUserId'] = asc_CCommentData.prototype.asc_getUserId;
asc_CCommentData.prototype['asc_putUserId'] = asc_CCommentData.prototype.asc_putUserId;
asc_CCommentData.prototype['asc_getUserName'] = asc_CCommentData.prototype.asc_getUserName;
asc_CCommentData.prototype['asc_putUserName'] = asc_CCommentData.prototype.asc_putUserName;
asc_CCommentData.prototype['asc_getQuoteText'] = asc_CCommentData.prototype.asc_getQuoteText;
asc_CCommentData.prototype['asc_putQuoteText'] = asc_CCommentData.prototype.asc_putQuoteText;
asc_CCommentData.prototype['asc_getSolved'] = asc_CCommentData.prototype.asc_getSolved;
asc_CCommentData.prototype['asc_putSolved'] = asc_CCommentData.prototype.asc_putSolved;
asc_CCommentData.prototype['asc_getReply'] = asc_CCommentData.prototype.asc_getReply;
asc_CCommentData.prototype['asc_addReply'] = asc_CCommentData.prototype.asc_addReply;
asc_CCommentData.prototype['asc_getRepliesCount'] = asc_CCommentData.prototype.asc_getRepliesCount;
Alexander.Trofimov's avatar
Alexander.Trofimov committed
5906
window['Asc']['CHyperlinkProperty'] = window['Asc'].CHyperlinkProperty = CHyperlinkProperty;
5907 5908 5909 5910 5911 5912 5913 5914 5915 5916 5917 5918
CHyperlinkProperty.prototype['get_Value'] = CHyperlinkProperty.prototype.get_Value;
CHyperlinkProperty.prototype['put_Value'] = CHyperlinkProperty.prototype.put_Value;
CHyperlinkProperty.prototype['get_ToolTip'] = CHyperlinkProperty.prototype.get_ToolTip;
CHyperlinkProperty.prototype['put_ToolTip'] = CHyperlinkProperty.prototype.put_ToolTip;
CHyperlinkProperty.prototype['get_Text'] = CHyperlinkProperty.prototype.get_Text;
CHyperlinkProperty.prototype['put_Text'] = CHyperlinkProperty.prototype.put_Text;
CHyperlinkProperty.prototype['get_Value'] = CHyperlinkProperty.prototype.get_Value;
CHyperlinkProperty.prototype['put_Value'] = CHyperlinkProperty.prototype.put_Value;
CHyperlinkProperty.prototype['get_ToolTip'] = CHyperlinkProperty.prototype.get_ToolTip;
CHyperlinkProperty.prototype['put_ToolTip'] = CHyperlinkProperty.prototype.put_ToolTip;
CHyperlinkProperty.prototype['get_Text'] = CHyperlinkProperty.prototype.get_Text;
CHyperlinkProperty.prototype['put_Text'] = CHyperlinkProperty.prototype.put_Text;
5919
window['AscCommonSlide'].CContextMenuData = CContextMenuData;
5920 5921 5922 5923 5924 5925 5926 5927 5928 5929 5930 5931 5932 5933 5934 5935 5936 5937 5938 5939 5940 5941 5942 5943 5944 5945 5946 5947 5948 5949 5950 5951 5952 5953 5954 5955 5956 5957 5958 5959 5960 5961 5962 5963 5964 5965 5966 5967 5968 5969 5970 5971 5972 5973 5974 5975 5976 5977 5978 5979 5980 5981 5982 5983 5984 5985 5986 5987 5988 5989 5990 5991 5992 5993 5994 5995 5996 5997 5998 5999 6000 6001 6002 6003 6004 6005 6006 6007 6008 6009 6010 6011 6012 6013 6014 6015 6016 6017
CContextMenuData.prototype['get_Type'] = CContextMenuData.prototype.get_Type;
CContextMenuData.prototype['get_X'] = CContextMenuData.prototype.get_X;
CContextMenuData.prototype['get_Y'] = CContextMenuData.prototype.get_Y;
CContextMenuData.prototype['get_IsSlideSelect'] = CContextMenuData.prototype.get_IsSlideSelect;
window['Asc']['CAscSlideProps'] = CAscSlideProps;
CAscSlideProps.prototype['get_background'] = CAscSlideProps.prototype.get_background;
CAscSlideProps.prototype['put_background'] = CAscSlideProps.prototype.put_background;
CAscSlideProps.prototype['get_timing'] = CAscSlideProps.prototype.get_timing;
CAscSlideProps.prototype['put_timing'] = CAscSlideProps.prototype.put_timing;
CAscSlideProps.prototype['get_LockDelete'] = CAscSlideProps.prototype.get_LockDelete;
CAscSlideProps.prototype['put_LockDelete'] = CAscSlideProps.prototype.put_LockDelete;
CAscSlideProps.prototype['get_LockLayout'] = CAscSlideProps.prototype.get_LockLayout;
CAscSlideProps.prototype['put_LockLayout'] = CAscSlideProps.prototype.put_LockLayout;
CAscSlideProps.prototype['get_LockTiming'] = CAscSlideProps.prototype.get_LockTiming;
CAscSlideProps.prototype['put_LockTiming'] = CAscSlideProps.prototype.put_LockTiming;
CAscSlideProps.prototype['get_LockBackground'] = CAscSlideProps.prototype.get_LockBackground;
CAscSlideProps.prototype['put_LockBackground'] = CAscSlideProps.prototype.put_LockBackground;
CAscSlideProps.prototype['get_LockTranzition'] = CAscSlideProps.prototype.get_LockTranzition;
CAscSlideProps.prototype['put_LockTranzition'] = CAscSlideProps.prototype.put_LockTranzition;
CAscSlideProps.prototype['get_LockRemove'] = CAscSlideProps.prototype.get_LockRemove;
CAscSlideProps.prototype['put_LockRemove'] = CAscSlideProps.prototype.put_LockRemove;
window['Asc']['CAscChartProp'] = CAscChartProp;
CAscChartProp.prototype['get_ChangeLevel'] = CAscChartProp.prototype.get_ChangeLevel;
CAscChartProp.prototype['put_ChangeLevel'] = CAscChartProp.prototype.put_ChangeLevel;
CAscChartProp.prototype['get_CanBeFlow'] = CAscChartProp.prototype.get_CanBeFlow;
CAscChartProp.prototype['get_Width'] = CAscChartProp.prototype.get_Width;
CAscChartProp.prototype['put_Width'] = CAscChartProp.prototype.put_Width;
CAscChartProp.prototype['get_Height'] = CAscChartProp.prototype.get_Height;
CAscChartProp.prototype['put_Height'] = CAscChartProp.prototype.put_Height;
CAscChartProp.prototype['get_WrappingStyle'] = CAscChartProp.prototype.get_WrappingStyle;
CAscChartProp.prototype['put_WrappingStyle'] = CAscChartProp.prototype.put_WrappingStyle;
CAscChartProp.prototype['get_Paddings'] = CAscChartProp.prototype.get_Paddings;
CAscChartProp.prototype['put_Paddings'] = CAscChartProp.prototype.put_Paddings;
CAscChartProp.prototype['get_AllowOverlap'] = CAscChartProp.prototype.get_AllowOverlap;
CAscChartProp.prototype['put_AllowOverlap'] = CAscChartProp.prototype.put_AllowOverlap;
CAscChartProp.prototype['get_Position'] = CAscChartProp.prototype.get_Position;
CAscChartProp.prototype['put_Position'] = CAscChartProp.prototype.put_Position;
CAscChartProp.prototype['get_PositionH'] = CAscChartProp.prototype.get_PositionH;
CAscChartProp.prototype['put_PositionH'] = CAscChartProp.prototype.put_PositionH;
CAscChartProp.prototype['get_PositionV'] = CAscChartProp.prototype.get_PositionV;
CAscChartProp.prototype['put_PositionV'] = CAscChartProp.prototype.put_PositionV;
CAscChartProp.prototype['get_Value_X'] = CAscChartProp.prototype.get_Value_X;
CAscChartProp.prototype['get_Value_Y'] = CAscChartProp.prototype.get_Value_Y;
CAscChartProp.prototype['get_ImageUrl'] = CAscChartProp.prototype.get_ImageUrl;
CAscChartProp.prototype['put_ImageUrl'] = CAscChartProp.prototype.put_ImageUrl;
CAscChartProp.prototype['get_Group'] = CAscChartProp.prototype.get_Group;
CAscChartProp.prototype['put_Group'] = CAscChartProp.prototype.put_Group;
CAscChartProp.prototype['asc_getFromGroup'] = CAscChartProp.prototype.asc_getFromGroup;
CAscChartProp.prototype['asc_putFromGroup'] = CAscChartProp.prototype.asc_putFromGroup;
CAscChartProp.prototype['get_isChartProps'] = CAscChartProp.prototype.get_isChartProps;
CAscChartProp.prototype['put_isChartPross'] = CAscChartProp.prototype.put_isChartPross;
CAscChartProp.prototype['get_SeveralCharts'] = CAscChartProp.prototype.get_SeveralCharts;
CAscChartProp.prototype['put_SeveralCharts'] = CAscChartProp.prototype.put_SeveralCharts;
CAscChartProp.prototype['get_SeveralChartTypes'] = CAscChartProp.prototype.get_SeveralChartTypes;
CAscChartProp.prototype['put_SeveralChartTypes'] = CAscChartProp.prototype.put_SeveralChartTypes;
CAscChartProp.prototype['get_SeveralChartStyles'] = CAscChartProp.prototype.get_SeveralChartStyles;
CAscChartProp.prototype['put_SeveralChartStyles'] = CAscChartProp.prototype.put_SeveralChartStyles;
CAscChartProp.prototype['get_VerticalTextAlign'] = CAscChartProp.prototype.get_VerticalTextAlign;
CAscChartProp.prototype['put_VerticalTextAlign'] = CAscChartProp.prototype.put_VerticalTextAlign;
CAscChartProp.prototype['get_Locked'] = CAscChartProp.prototype.get_Locked;
CAscChartProp.prototype['get_ChartProperties'] = CAscChartProp.prototype.get_ChartProperties;
CAscChartProp.prototype['put_ChartProperties'] = CAscChartProp.prototype.put_ChartProperties;
CAscChartProp.prototype['get_ShapeProperties'] = CAscChartProp.prototype.get_ShapeProperties;
CAscChartProp.prototype['put_ShapeProperties'] = CAscChartProp.prototype.put_ShapeProperties;
CAscChartProp.prototype['asc_getType'] = CAscChartProp.prototype.asc_getType;
CAscChartProp.prototype['asc_getSubType'] = CAscChartProp.prototype.asc_getSubType;
CAscChartProp.prototype['asc_getStyleId'] = CAscChartProp.prototype.asc_getStyleId;
CAscChartProp.prototype['asc_getHeight'] = CAscChartProp.prototype.asc_getHeight;
CAscChartProp.prototype['asc_getWidth'] = CAscChartProp.prototype.asc_getWidth;
CAscChartProp.prototype['asc_setType'] = CAscChartProp.prototype.asc_setType;
CAscChartProp.prototype['asc_setSubType'] = CAscChartProp.prototype.asc_setSubType;
CAscChartProp.prototype['asc_setStyleId'] = CAscChartProp.prototype.asc_setStyleId;
CAscChartProp.prototype['asc_setHeight'] = CAscChartProp.prototype.asc_setHeight;
CAscChartProp.prototype['asc_setWidth'] = CAscChartProp.prototype.asc_setWidth;
CAscChartProp.prototype['getType'] = CAscChartProp.prototype.getType;
CAscChartProp.prototype['putType'] = CAscChartProp.prototype.putType;
CAscChartProp.prototype['getStyle'] = CAscChartProp.prototype.getStyle;
CAscChartProp.prototype['putStyle'] = CAscChartProp.prototype.putStyle;
CAscChartProp.prototype['changeType'] = CAscChartProp.prototype.changeType;
CDocInfoProp.prototype['get_PageCount'] = CDocInfoProp.prototype.get_PageCount;
CDocInfoProp.prototype['put_PageCount'] = CDocInfoProp.prototype.put_PageCount;
CDocInfoProp.prototype['get_WordsCount'] = CDocInfoProp.prototype.get_WordsCount;
CDocInfoProp.prototype['put_WordsCount'] = CDocInfoProp.prototype.put_WordsCount;
CDocInfoProp.prototype['get_ParagraphCount'] = CDocInfoProp.prototype.get_ParagraphCount;
CDocInfoProp.prototype['put_ParagraphCount'] = CDocInfoProp.prototype.put_ParagraphCount;
CDocInfoProp.prototype['get_SymbolsCount'] = CDocInfoProp.prototype.get_SymbolsCount;
CDocInfoProp.prototype['put_SymbolsCount'] = CDocInfoProp.prototype.put_SymbolsCount;
CDocInfoProp.prototype['get_SymbolsWSCount'] = CDocInfoProp.prototype.get_SymbolsWSCount;
CDocInfoProp.prototype['put_SymbolsWSCount'] = CDocInfoProp.prototype.put_SymbolsWSCount;
CHeader.prototype['get_headerText'] = CHeader.prototype.get_headerText;
CHeader.prototype['get_pageNumber'] = CHeader.prototype.get_pageNumber;
CHeader.prototype['get_X'] = CHeader.prototype.get_X;
CHeader.prototype['get_Y'] = CHeader.prototype.get_Y;
CHeader.prototype['get_Level'] = CHeader.prototype.get_Level;
CSearchResult.prototype['get_Text'] = CSearchResult.prototype.get_Text;
CSearchResult.prototype['get_Navigator'] = CSearchResult.prototype.get_Navigator;
CSearchResult.prototype['put_Navigator'] = CSearchResult.prototype.put_Navigator;
CSearchResult.prototype['put_Text'] = CSearchResult.prototype.put_Text;
6018

Alexander.Trofimov's avatar
Alexander.Trofimov committed
6019
window['Asc']['CTablePropLook'] = window['Asc'].CTablePropLook = CTablePropLook;
6020 6021 6022 6023 6024 6025 6026 6027 6028 6029 6030 6031
CTablePropLook.prototype['get_FirstCol'] = CTablePropLook.prototype.get_FirstCol;
CTablePropLook.prototype['put_FirstCol'] = CTablePropLook.prototype.put_FirstCol;
CTablePropLook.prototype['get_FirstRow'] = CTablePropLook.prototype.get_FirstRow;
CTablePropLook.prototype['put_FirstRow'] = CTablePropLook.prototype.put_FirstRow;
CTablePropLook.prototype['get_LastCol'] = CTablePropLook.prototype.get_LastCol;
CTablePropLook.prototype['put_LastCol'] = CTablePropLook.prototype.put_LastCol;
CTablePropLook.prototype['get_LastRow'] = CTablePropLook.prototype.get_LastRow;
CTablePropLook.prototype['put_LastRow'] = CTablePropLook.prototype.put_LastRow;
CTablePropLook.prototype['get_BandHor'] = CTablePropLook.prototype.get_BandHor;
CTablePropLook.prototype['put_BandHor'] = CTablePropLook.prototype.put_BandHor;
CTablePropLook.prototype['get_BandVer'] = CTablePropLook.prototype.get_BandVer;
CTablePropLook.prototype['put_BandVer'] = CTablePropLook.prototype.put_BandVer;
6032
})(window, window.document);