Adobe.com
Contents Suites Classes Class Index Member Index

AIScriptMessage.h

Go to the documentation of this file.
00001 #ifndef __AIScriptMessage__
00002 #define __AIScriptMessage__
00003 
00004 /*
00005  *        Name: AIScriptMessage.h
00006  *              $Id $
00007  *      Author:
00008  *        Date:
00009  *     Purpose: Adobe Illustrator AIScriptMessage.
00010  *
00011  * Copyright (c) 2010 Adobe Systems Incorporated, All Rights Reserved.
00012  *
00013  */
00014 
00015 
00016 /*******************************************************************************
00017  **
00018  **     Imports
00019  **
00020  **/
00021 #ifndef __AITypes__
00022 #include "AITypes.h"
00023 #endif
00024 
00025 #ifndef __SPAccess__
00026 #include "SPAccess.h"
00027 #endif
00028 
00029 #include "IAIUnicodeString.h"
00030 
00031 #include "AIHeaderBegin.h"
00032 
00034 /*******************************************************************************
00035  **
00036  **     Constants
00037  **
00038  **/
00039 #define kCallerAIScriptMessage                          "AI Script Message Caller"
00040 
00041 
00045 struct AIScriptMessage {
00047         AIScriptMessage():art(NULL) {}
00049         SPMessageData d;
00051         AIArtHandle art;
00053         ai::UnicodeString inParam;
00055         ai::UnicodeString outParam;
00056 };
00057 
00058 /*
00059 Sample code to send a script message
00060 
00061 AIErr SendScriptMessage(const char* pluginName, const char* selector, const ai::Unicodestring& inputString, ai::Unicodestring& outString)
00062 {
00063         SPPluginRef pluginRef;
00064         error = sSPPlugins->GetNamedPlugin(pluginName, &pluginRef);
00065 
00066         if (!error)
00067         {
00068                 AIScriptMessage msg;
00069                 msg.inParam = inputString;
00070 
00071                 error = sSPInterface->SetupMessageData(pluginRef, &msg.d);
00072                 if (!error)
00073                 {
00074                         error = sSPInterface->SendMessage(pluginRef, kCallerAIScriptMessage, selector, &msg, &spResult);
00075                         if (spResult)
00076                                 error = spResult;
00077 
00078                         sSPInterface->EmptyMessageData(pluginRef, &msg.d);
00079 
00080                         if(!error)
00081                                 outString = msg.outParam;
00082                 }
00083         }
00084 
00085         return error;
00086 }
00087 */
00088 #include "AIHeaderEnd.h"
00089 
00090 
00091 #endif // __AIScriptMessage__


Contents Suites Classes Class Index Member Index
Adobe Solutions Network
 
Copyright © 2014 Adobe Systems Incorporated. All rights reserved.
Terms of Use Online Privacy Policy Adobe and accessibility Avoid software piracy Permissions and Trademarks